aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/url_for.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/url_for.rb b/actionpack/lib/action_controller/metal/url_for.rb
index ca91e1f362..ae628df81c 100644
--- a/actionpack/lib/action_controller/metal/url_for.rb
+++ b/actionpack/lib/action_controller/metal/url_for.rb
@@ -5,20 +5,16 @@ module ActionController
include ActionDispatch::Routing::UrlFor
def url_options
- options = {}
- if respond_to?(:env) && env
- if _routes.equal?(env["action_dispatch.routes"])
- options[:skip_prefix] = true
- elsif env["action_dispatch.routes"]
- options[:script_name] = _routes.default_url_options[:script_name]
+ options = {}
+ if respond_to?(:env) && env && _routes.equal?(env["action_dispatch.routes"])
+ options[:script_name] = request.script_name
end
- end
super.merge(options).reverse_merge(
:host => request.host_with_port,
:protocol => request.protocol,
:_path_segments => request.symbolized_path_parameters
- ).reverse_merge(:script_name => request.script_name)
+ )
end
def _routes