InstantRails newbie question

I am following the tutorial 'Rolling with Ruby On Instant Rails'. I tried creating the cookbook2 application. It worked the first time.

To practice, I tried it three times in total and it worked. Now I am trying it the fourth time and I've done it till the step of editing the controller class for 'recipe' to add the line:

scaffold :recipe

When I browse to localhost:3000/cookbook2/list

I get an error:

no route found to match "/cookbook2" with {:method=>:get}

I have my Web server running on port 3000. I am sure about that.

Please help.

Mukesh Singh wrote:

I am following the tutorial 'Rolling with Ruby On Instant Rails'. I tried creating the cookbook2 application. It worked the first time.

To practice, I tried it three times in total and it worked. Now I am trying it the fourth time and I've done it till the step of editing the controller class for 'recipe' to add the line:

scaffold :recipe

When I browse to localhost:3000/cookbook2/list

I get an error:

no route found to match "/cookbook2" with {:method=>:get}   

Hi Mukesh,

I'm guessing that you created a controller called recipe or recipes or something like that and added the scaffold line to it. If that's the case, you should be accessing the URL:

localhost:3000/recipe/list or localhost:3000/recipes/list

The general convention in Rails (without any special routing) is: server:port/{controller}/{action}/{id}

Cheers, Mohit. 11/13/2007 | 12:10 AM.

Thanks very much, Mohit.

I think because of the repetition, it got stale in my head and I wired up the wrong URL. Thanks very much. That was what it was supposed to be and it works now.

I can proceed with studying more now.

Mukesh Singh wrote:

Thanks very much, Mohit.

I think because of the repetition, it got stale in my head and I wired up the wrong URL. Thanks very much. That was what it was supposed to be and it works now.

I can proceed with studying more now.    Good luck and welcome to Rails!

Cheers, Mohit. 11/13/2007 | 12:31 AM.