aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/http/url.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index 7ca1636780..a6c17f50a5 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -37,12 +37,6 @@ module ActionDispatch
path = options[:script_name].to_s.chomp("/")
path << options[:path].to_s
- if options[:only_path]
- result = ''
- else
- result = build_host_url(options)
- end
-
if options[:trailing_slash]
if path.include?('?')
path.sub!(/\?/, '/\&')
@@ -51,7 +45,11 @@ module ActionDispatch
end
end
- result << path
+ result = path
+
+ unless options[:only_path]
+ result.prepend build_host_url(options)
+ end
if options.key? :params
params = options[:params].is_a?(Hash) ?