Skip to content

Commit

Permalink
Add a note about shallow routes
Browse files Browse the repository at this point in the history
  • Loading branch information
freemanoid committed Jul 12, 2015
1 parent 2133777 commit 537fb7e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ programming resources.
resources :comments
end
```
* <a name="namespaced-routes"></a>
If you need to nest routes more than 1 level deep then use the `shallow: true` option. This will save user from long urls `posts/1/comments/5/versions/7/edit` and you from long url helpers `edit_post_comment_version`.
```Ruby
resources :posts, shallow: true do
resources :comments do
resources :versions
end
end
```
* <a name="namespaced-routes"></a>
Use namespaced routes to group related actions.
Expand Down

0 comments on commit 537fb7e

Please sign in to comment.