Cleaner way to add routes to already defined resources :users
My routes.rb has:
resources :users
Now if I add more routes in my users_controller, is there a way to bunch them together somehow开发者_运维问答 instead of having a seperate line for each new route I add?
resources :users
# routes for signin, signout, password_recovery that are in users_controller
This is rails 3.
You can add routes that act on the collection or individual members with the member
and collection
block.
See the "Adding More RESTful Actions" section of the Rail's routing guide.
精彩评论