small medium large xlarge

29 Jul 2008, 18:01
Rob (2 posts)


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

09 Oct 2008, 22:06
Jason Franklin-Stokes (4 posts)

In routes.rb, you need to add ‘game’, :controller => ‘game’, :action => ‘index’

or better

map.resources :games

09 Jan 2009, 06:50
Terjin TJ Dhillon (13 posts)

Yep what jason said is right…in the book it was “automagically” done for us because we used a scaffold to do it..

  You must be logged in to comment