1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add short note on using url_for instead of directly calling named route in polymorphic_url

This commit is contained in:
Piotr Sarnacki 2010-08-25 15:59:25 +02:00
parent 613cbe1f00
commit 706a3223a3

View file

@ -129,6 +129,9 @@ module ActionDispatch
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
end