Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for shallow nesting of routes. [#838 state:resolved]
Adds :shallow option to resource route definition. If true, paths for nested resources which reference a specific member (ie. those with an :id parameter) will not use the parent path prefix or name prefix. Example : map.resources :users, :shallow => true do |user| user.resources :posts end * GET /users/1/posts (maps to PostsController#index action as usual) named route "user_posts" is added as usual. * GET /posts/2 (maps to PostsController#show action as if it were not nested) Additionally, named route "post" is added too.
- Loading branch information
Showing
3 changed files
with
184 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
83c6ba1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWESOME. Does this already exist as a plugin? If not, I might have a crack at it.
83c6ba1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWESOME. Does this already exist as a plugin? If not, I might have a crack at it.
83c6ba1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argh. sorry for the double post, timed out on the first.
83c6ba1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool!
But new_{resource}_path is not supported for the nested resource, can we add that too?