I’m trying to map my rails homepage to a page generated by a resource, and I’m having a little difficulty getting the required parameter into the route. I’m looking for something like:
root :to => "pages#show", :slug => 'home'
…which doesn’t work. Any suggestions appreciated.
You could put a default in your Pages SHOW action, so that instead of Record Not Found you’d load home if you were requesting Pages#show without a parameter. IE:
Then your existing setup:
root :to => "pages#show"should work as expected.