aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/polymorphic_routes.rb')
-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