aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-07-25 05:02:00 -0700
committerJosé Valim <jose.valim@gmail.com>2011-07-25 05:02:00 -0700
commitdffd920432380143417a0e9ac80de9d017ab223e (patch)
treece5f8e923f5acee297bfdacd3d6bd271f5c90339 /actionpack/lib
parent02691d3516e68b2de5545ec7a495024a377f89fc (diff)
parent036f77574d5cd095b9ea78e2fd927c8d7764bd31 (diff)
downloadrails-dffd920432380143417a0e9ac80de9d017ab223e.tar.gz
rails-dffd920432380143417a0e9ac80de9d017ab223e.tar.bz2
rails-dffd920432380143417a0e9ac80de9d017ab223e.zip
Merge pull request #2252 from thedarkone/polymorphic-url-helpers
Make polymorphic_url calls go through application helpers again.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/polymorphic_routes.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
index 49aef0bf72..e989a38d8b 100644
--- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
+++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -124,14 +124,7 @@ module ActionDispatch
args.last.kind_of?(Hash) ? args.last.merge!(url_options) : args << url_options
end
- if proxy
- proxy.send(named_route, *args)
- else
- # we need to use url_for, because polymorphic_url can be used in context of other than
- # current routes (e.g. engine's routes). As named routes from engine are not included
- # calling engine's named route directly would fail.
- url_for _routes.url_helpers.__send__("hash_for_#{named_route}", *args)
- end
+ (proxy || self).send(named_route, *args)
end
# Returns the path component of a URL for the given record. It uses