Generic-user-small Rob 2 posts

Hi,

I have been working on a project and followed the book. But I have problems when making a new table in the database.

I do;
model Player name:string email:string etc…
controller player index

then another model;
model Game venue:string homescore:integer awayscore:integer
controller game

I make index.html.erb and program it to list all the game (code all right) but when I access /game I get;

Routing Error

No route matches ”/game” with {:method=>:get}

Hope you can help, thanks

 
Generic-user-small Jason Frankl... 4 posts

In routes.rb, you need to add

map.game ‘game’, :controller => ‘game’, :action => ‘index’

or better

map.resources :games

2 posts, 2 voices