From f2f556d583aebf95f2f5163c96538ae6b6437d38 Mon Sep 17 00:00:00 2001 From: Florent Guilleux Date: Sun, 26 Feb 2012 19:07:16 -0500 Subject: document how to create non show paths from an array of parameters --- railties/guides/source/routing.textile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'railties/guides/source') 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 %> +For other actions, you just need to insert the action name as the first element of the +Array+: + + +<%= link_to "Edit Ad", [:edit, @magazine, @ad] %> + + 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 -- cgit v1.2.3