This project is archived and is in readonly mode.

#2746 ✓committed
Jeffrey Hardy

UrlRewriter should call #to_param on the value given in :anchor

Reported by Jeffrey Hardy | June 2nd, 2009 @ 08:07 PM | in 2.x

UrlWriter#url_for method calls #to_param on the value given via the :anchor option:

url_for(:host => 'www.example.com', :controller => 'comments', :anchor => Comment.first)
# => "http://www.example.com/comments#1"

but UrlRewriter#rewrite_url does not:

comments_url(:anchor => Comment.first)
# => "http://www.example.com/comments##<Comment:0x37cc100>"

This patch makes #rewrite_url follow suit.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments