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

Joern Akkermann picture Joern Akkermann · Jun 29, 2011 · Viewed 75.1k times · Source

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?

Answer

Matthew D. picture Matthew D. · Jul 21, 2011

Had this same problem and this worked for me:

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