diff options
author | Linux on Rails <linuxonrails@linuxonrails.com> | 2011-06-03 03:01:41 -0700 |
---|---|---|
committer | Linux on Rails <linuxonrails@linuxonrails.com> | 2011-06-03 03:01:41 -0700 |
commit | 72f51990b72482df41c1711b43e77f94177224be (patch) | |
tree | b4d3f7fb82238b610bc556b925ff36f791e9d7c7 | |
parent | caa8ab09f769b57bb06a333f5e81d6ad10be1495 (diff) | |
download | rails-72f51990b72482df41c1711b43e77f94177224be.tar.gz rails-72f51990b72482df41c1711b43e77f94177224be.tar.bz2 rails-72f51990b72482df41c1711b43e77f94177224be.zip |
FIXED: error with url_for & link_to when we have nested resources.
-rw-r--r-- | railties/guides/source/routing.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 08615bed4e..1cbc5c8f6e 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -288,7 +288,7 @@ When using +magazine_ad_path+, you can pass in instances of +Magazine+ and +Ad+ You can also use +url_for+ with a set of objects, and Rails will automatically determine which route you want: <erb> -<%= link_to "Ad details", url_for(@magazine, @ad) %> +<%= link_to "Ad details", url_for([@magazine, @ad]) %> </erb> In this case, Rails will see that +@magazine+ is a +Magazine+ and +@ad+ is an +Ad+ and will therefore use the +magazine_ad_path+ helper. In helpers like +link_to+, you can specify just the object in place of the full +url_for+ call: |