This project is archived and is in readonly mode.
auto_link does not add attributes to hrefs like the docs describe
Reported by javan (at javan) | September 21st, 2009 @ 09:21 PM
This is only a problem with the "new" API for auto_link, the old API works fine. An example from the console:
$ script/console
Loading development environment (Rails 2.3.4)
>> include ActionView::Helpers::TextHelper
=> Object
>> include ActionView::Helpers::TagHelper
=> Object
# The docs say this should work:
>> auto_link("http://google.com", :href_options => { :target => "_blank" })
=> "<a href=\"http://google.com\">http://google.com</a>"
# This works:
>> auto_link("http://google.com", :urls, :target => "_blank")
=> "<a href=\"http://google.com\" target=\"_blank\">http://google.com</a>"
Comments and changes to this ticket
-
CancelProfileIsBroken September 25th, 2009 @ 11:56 AM
- Tag changed from auto_link to auto_link, bugmash
-
Lena Herrmann September 26th, 2009 @ 04:30 PM
This is actually an error in the documentation, it can be fixed with patch in ticket #2261. That patch has been applied to docrails, but not to the actual rails code.
-
Lena Herrmann September 26th, 2009 @ 04:38 PM
- Tag changed from auto_link, bugmash to auto_link, bugmash, bugmash-review
-
CancelProfileIsBroken September 27th, 2009 @ 12:09 PM
- Tag changed from auto_link, bugmash, bugmash-review to auto_link
- State changed from new to resolved
Thanks for the sleuthing, Lena. The docrails patch will make its way back to the main tree eventually, so we can close this one out.
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>