aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/url_rewriter.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-07-14 09:28:56 +0000
committerMichael Koziarski <michael@koziarski.com>2007-07-14 09:28:56 +0000
commit5476a6a6c7e3be5722481a2bd3b60322f1672c1e (patch)
treef34a4599aac4de840fc80eb65294bebee196e50f /actionpack/lib/action_controller/url_rewriter.rb
parentf9b7394430f50c110b0f07d7e3c06d5b3d9b0f44 (diff)
downloadrails-5476a6a6c7e3be5722481a2bd3b60322f1672c1e.tar.gz
rails-5476a6a6c7e3be5722481a2bd3b60322f1672c1e.tar.bz2
rails-5476a6a6c7e3be5722481a2bd3b60322f1672c1e.zip
Make :trailing_slash work with query parameters for url_for. Closes #4004 [nov]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7186 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/url_rewriter.rb')
-rw-r--r--actionpack/lib/action_controller/url_rewriter.rb6
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