This project is archived and is in readonly mode.
option_groups_from_collection_for_select should produce an HTML-safe string
Reported by Wincent Colaiuta | June 16th, 2010 @ 10:53 PM
Just noticed this in a Rails 2 app upgraded to Rails 3 (beta 4).
Looks like the "option_groups_from_collection_for_select" helper produces a string of HTML which isn't marked using ".html_safe", so when you try to use it in a view it ends up getting escaped.
I haven't gone over all the other methods in actionpack/lib/action_view/helpers/form_options_helper.rb, but at a glance most of them look to be right and call .html_safe on the result before returning it.
Looks like option_groups_from_collection_for_select is missing the call.
options_from_collection_for_select looks to be ok, seeing as it just returns the output from options_for_select, which is marked as HTML-safe.
Comments and changes to this ticket
-
Wincent Colaiuta June 17th, 2010 @ 08:21 AM
- Tag set to patch
Fix pushed to the "ticket4879" branch in my fork:
http://github.com/wincent/rails/commits/ticket4879
Specifically this commit:
http://github.com/wincent/rails/commit/3c3aaa761a941183d66be1854e7e...
Will also attach as a patch.
-
Repository June 19th, 2010 @ 04:25 PM
- State changed from new to resolved
(from [728b9eccad99d22028577e8b06433e8344b15d01]) option_groups_from_collection_for_select should return HTML-safe string [#4879 state:resolved]
Signed-off-by: Xavier Noria fxn@hashref.com
http://github.com/rails/rails/commit/728b9eccad99d22028577e8b06433e...
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
- Nobody is watching this ticket.
Attachments
Tags
Referenced by
- 4879 option_groups_from_collection_for_select should produce an HTML-safe string (from [728b9eccad99d22028577e8b06433e8344b15d01]) option_...