aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/routing.textile
diff options
context:
space:
mode:
authorFlorent Guilleux <florent2@gmail.com>2012-02-26 19:07:16 -0500
committerFlorent Guilleux <florent2@gmail.com>2012-02-26 19:07:16 -0500
commitf2f556d583aebf95f2f5163c96538ae6b6437d38 (patch)
tree57e7425f180d6a5f71f89e66a857b1e360216ef0 /railties/guides/source/routing.textile
parent25ad2e934538e65141fc6dccbeecdb280017284b (diff)
downloadrails-f2f556d583aebf95f2f5163c96538ae6b6437d38.tar.gz
rails-f2f556d583aebf95f2f5163c96538ae6b6437d38.tar.bz2
rails-f2f556d583aebf95f2f5163c96538ae6b6437d38.zip
document how to create non show paths from an array of parameters
Diffstat (limited to 'railties/guides/source/routing.textile')
-rw-r--r--railties/guides/source/routing.textile6
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile
index df2bd9d0c9..24e7d09a49 100644
--- a/railties/guides/source/routing.textile
+++ b/railties/guides/source/routing.textile
@@ -301,6 +301,12 @@ If you wanted to link to just a magazine, you could leave out the +Array+:
<%= 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