KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I like all the default routes that are generated by Rail's map.resources . But, there are cases where I would like to use a non-numeric identifier in my routes. For example, If have a nested route consist of users and their articles, a standard route could be written as such: map.resources :users, :has_many => [:articles] # => e.g. '/users/:id/articles/:id' However, there are many advantages / reasons not to use the default numerical identifier generated by Rails. Is there a way to replace the default :id params to another canonical identifier of my choice without resulting to writing custom routes for every standard action? Say if I want a route in the following format: '/users/:login/articles/:id' Is this kind of routes achievable using map.resources ?
Tags (comma-separated)
Save Edits
Cancel