29

In rails 2.3.5 you could do something like this inside the routes.rb file:

map.root :controller => "pages", :action => "show", :id => 3

In rails 3 I haven't found any way to pass a specific parameter (like in rails 2.3.5 with :id => 3).

I know I can handle it from the controller and have the same result (which I did), but I was wondering if there is a way to do the same thing in rails 3 from the routes.rb or has it changed because it is better practice for some reason?

JohnDel
  • 2,092
  • 8
  • 35
  • 64

1 Answers1

56

Are you sure the following doesn't work?

root :to => "pages#show", :id => 3
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
  • Well, it works, I thought I had tested it but now I tried it to be sure and it is working... thank you! It was in front of my eyes :) – JohnDel Aug 20 '10 at 20:44