diff options
Diffstat (limited to 'railties/guides/source/routing.textile')
-rw-r--r-- | railties/guides/source/routing.textile | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index df2bd9d0c9..42665114be 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -295,12 +295,18 @@ In this case, Rails will see that +@magazine+ is a +Magazine+ and +@ad+ is an +A <%= link_to "Ad details", [@magazine, @ad] %> </erb> -If you wanted to link to just a magazine, you could leave out the +Array+: +If you wanted to link to just a magazine: <erb> <%= link_to "Magazine details", @magazine %> </erb> +For other actions, you just need to insert the action name as the first element of the array: + +<erb> +<%= link_to "Edit Ad", [:edit, @magazine, @ad] %> +</erb> + This allows you to treat instances of your models as URLs, and is a key advantage to using the resourceful style. h4. Adding More RESTful Actions |