Search code examples
ruby-on-railsrubyruby-on-rails-3routesurl-routing

Rails Routing (root :to => ...)


I know how to set the routes root of my rails app to a controller and an action.

But how to add an id?

/pages/show/1 should be the root.

How do I set this?


Solution

  • Had this same problem and this worked for me:

    root :to => "pages#show", :id => '1'