I'm looking to make a show action of one of my controllers the root. I can easily do this:
map.root :controller => 'articles', :action => 'index'
When I go to localhost:3000/ it lists all the articles - that's great! What I want to achieve, though, is a URL like this
localhost:3000/1
To display an article with the id 1. Changing the route the the following would be what I'd think I have to do:
map.root :controller => 'articles', :action => 'show'
But it does not seem to work. Instead - it looks for a controller called 1
- which does not exist.
How would I go about doing this?
Thank you!