diff options
author | Jeffrey Hardy <packagethief@gmail.com> | 2009-06-02 13:28:44 -0400 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-08-26 14:11:26 -0700 |
commit | 05b529ca57f75ce64540b9d34597e0c3bfe1fca7 (patch) | |
tree | d1f751066283ba20581ab73c4f006872fcbcc393 /actionpack/lib | |
parent | cc9af20da7af98464ece18d4abc6a22ef3f00b5d (diff) | |
download | rails-05b529ca57f75ce64540b9d34597e0c3bfe1fca7.tar.gz rails-05b529ca57f75ce64540b9d34597e0c3bfe1fca7.tar.bz2 rails-05b529ca57f75ce64540b9d34597e0c3bfe1fca7.zip |
UrlRewriter#rewrite_url should call #to_param on the value given in :anchor option, just as #url_for does
[#2746 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/routing/generation/url_rewriter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing/generation/url_rewriter.rb b/actionpack/lib/action_controller/routing/generation/url_rewriter.rb index 9717582b5e..52b66c9303 100644 --- a/actionpack/lib/action_controller/routing/generation/url_rewriter.rb +++ b/actionpack/lib/action_controller/routing/generation/url_rewriter.rb @@ -172,7 +172,7 @@ module ActionController path = rewrite_path(options) rewritten_url << ActionController::Base.relative_url_root.to_s unless options[:skip_relative_url_root] rewritten_url << (options[:trailing_slash] ? path.sub(/\?|\z/) { "/" + $& } : path) - rewritten_url << "##{options[:anchor]}" if options[:anchor] + rewritten_url << "##{CGI.escape(options[:anchor].to_param.to_s)}" if options[:anchor] rewritten_url end |