Changing default REST routes in Rails 3
- by Vincent
I need to add one parameter to the default REST route for the show action for SEO purposes:
resources :neighborhoods, :only => [:index, :show]
neighborhood_url(neighborhood) # => /neighborhoods/lower-east-side
I want something like the following:
neighborhood_url(city, neighborhood) # => /neighborhoods/manhattan/lower-east-side
What would be the easiest way to do this without using nested routes and without breaking Rails REST conventions?