diff options
Diffstat (limited to 'railties/doc/guides/source')
-rw-r--r-- | railties/doc/guides/source/2_2_release_notes.txt | 2 | ||||
-rw-r--r-- | railties/doc/guides/source/routing_outside_in.txt | 12 |
2 files changed, 2 insertions, 12 deletions
diff --git a/railties/doc/guides/source/2_2_release_notes.txt b/railties/doc/guides/source/2_2_release_notes.txt index 715648b95e..ff285b85cd 100644 --- a/railties/doc/guides/source/2_2_release_notes.txt +++ b/railties/doc/guides/source/2_2_release_notes.txt @@ -212,7 +212,7 @@ On the controller side, there are a couple of changes that will help tidy up you === Shallow Route Nesting -Shallow route nesting provides a solution to the well-known difficulty of using deeply-nested resources. With shallow nesting, you need only supply enough information to uniquely identify the resource that you want to work with - but you _can_ supply more information. +Shallow route nesting provides a solution to the well-known difficulty of using deeply-nested resources. With shallow nesting, you need only supply enough information to uniquely identify the resource that you want to work with. [source, ruby] ------------------------------------------------------- diff --git a/railties/doc/guides/source/routing_outside_in.txt b/railties/doc/guides/source/routing_outside_in.txt index 6d127973b0..a9ebb7bc36 100644 --- a/railties/doc/guides/source/routing_outside_in.txt +++ b/railties/doc/guides/source/routing_outside_in.txt @@ -535,17 +535,7 @@ This will enable recognition of (among others) these routes: /photos/3 ==> photo_path(3) ------------------------------------------------------- -With shallow nesting, you need only supply enough information to uniquely identify the resource that you want to work with - but you _can_ supply more information. All of the nested routes continue to work, just as they would without shallow nesting, but less-deeply nested routes (even direct routes) work as well. So, with the declaration above, all of these routes refer to the same resource: - -------------------------------------------------------- -/publishers/1/magazines/2/photos/3 ==> publisher_magazine_photo_path(1,2,3) -/magazines/2/photos/3 ==> magazine_photo_path(2,3) -/photos/3 ==> photo_path(3) -------------------------------------------------------- - -Shallow nesting gives you the flexibility to use the shorter direct routes when you like, while still preserving the longer nested routes for times when they add code clarity. - -If you like, you can combine shallow nesting with the +:has_one+ and +:has_many+ options: +With shallow nesting, you need only supply enough information to uniquely identify the resource that you want to work with. If you like, you can combine shallow nesting with the +:has_one+ and +:has_many+ options: [source, ruby] ------------------------------------------------------- |