For the caching purpose I can’t have url like /users/2/index?month=2009-02 . The problem with this approach is that if I do page caching then same page is returned even for /users/2/index?month=2009-03 .
To solve the caching issue I would like to have url like /users/2/events/2009-02.html . I have defined users to be a restful resource.
map.resources :users
Does anyone know how to get url like /users/2/events/2009-02.html which will map to
controller = users
action = events
id = 2 or user_id = 2
month = 2009-02
In your application’s routes file, you can set up a named route like this:
The routing DSL has changed a lot in Rails 3. Now you would do something more like this:
There’s more information on routing here: http://guides.rubyonrails.org/routing.html