This project is archived and is in readonly mode.

#4879 ✓resolved
Wincent Colaiuta

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

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=""></a>

People watching this ticket



Referenced by