diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/url_rewriter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index 384c818254..3b2af2e1c2 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -89,9 +89,9 @@ module ActionController rewritten_url << ":#{options.delete(:port)}" if options.key?(:port) end + path = rewrite_path(options) rewritten_url << @request.relative_url_root.to_s unless options[:skip_relative_url_root] - rewritten_url << rewrite_path(options) - rewritten_url << '/' if options[:trailing_slash] + rewritten_url << (options[:trailing_slash] ? path.sub(/\?|\z/) { "/" + $& } : path) rewritten_url << "##{options[:anchor]}" if options[:anchor] rewritten_url @@ -121,4 +121,4 @@ module ActionController end end end -end
\ No newline at end of file +end |