aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorthedarkone <thedarkone2@gmail.com>2011-06-06 14:13:06 +0200
committerthedarkone <thedarkone2@gmail.com>2011-07-25 13:43:02 +0200
commit036f77574d5cd095b9ea78e2fd927c8d7764bd31 (patch)
treece5f8e923f5acee297bfdacd3d6bd271f5c90339 /actionpack/lib
parent02691d3516e68b2de5545ec7a495024a377f89fc (diff)
downloadrails-036f77574d5cd095b9ea78e2fd927c8d7764bd31.tar.gz
rails-036f77574d5cd095b9ea78e2fd927c8d7764bd31.tar.bz2
rails-036f77574d5cd095b9ea78e2fd927c8d7764bd31.zip
Make polymorphic_url calls go through application helpers again.
This brings back the ability to overwrite/extend url generating methods in application heleprs.
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