I want to make the show action one of my root controllers. I can easily do this:
map.root :controller => 'articles', :action => 'index'
When I switch to localhost: 3000 / it lists all the articles - that's great! However, I want this URL to be as follows:
localhost:3000/1
To display the article with ID 1. Having changed the route, I would have thought that I should do the following:
map.root :controller => 'articles', :action => 'show'
But that does not work. Instead, he searches for a controller called 1- which does not exist.
How should I do it?
Thank!
source
share