Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

option_groups_from_collection_for_select should produce an HTML-safe string

#4879

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.

Reported by Wincent Colaiuta · June 16th, 2010 @ 10:53 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none