diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2013-05-03 16:42:31 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2013-05-03 18:15:40 +0200 |
commit | 9a4268db99d93190c58bddcb150832727a0d5129 (patch) | |
tree | fc45c239e93bbac8396c4566325bd663eb8cc980 /actionpack/lib/action_controller/metal | |
parent | f1af9f83757278f5f852f9c747dd367f1a591833 (diff) | |
download | rails-9a4268db99d93190c58bddcb150832727a0d5129.tar.gz rails-9a4268db99d93190c58bddcb150832727a0d5129.tar.bz2 rails-9a4268db99d93190c58bddcb150832727a0d5129.zip |
Fix generating route from engine to other engine
A regression was introduced in 5b3bb6, generating route from within an
engine to an another engine resulted in prefixing a path with the
SCRIPT_NAME value.
The regression was caused by the fact that SCRIPT_NAME should be
appended only if it's the SCRIPT_NAME for the application, not if it's
SCRIPT_NAME from the current engine.
closes #10409
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/url_for.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/url_for.rb b/actionpack/lib/action_controller/metal/url_for.rb index 505f3b4e61..754249cbc8 100644 --- a/actionpack/lib/action_controller/metal/url_for.rb +++ b/actionpack/lib/action_controller/metal/url_for.rb @@ -32,7 +32,8 @@ module ActionController if (same_origin = _routes.equal?(env["action_dispatch.routes"])) || (script_name = env["ROUTES_#{_routes.object_id}_SCRIPT_NAME"]) || - (original_script_name = env['SCRIPT_NAME']) + (original_script_name = env['ORIGINAL_SCRIPT_NAME']) + @_url_options.dup.tap do |options| if original_script_name options[:original_script_name] = original_script_name |