This project is archived and is in readonly mode.

#5702 ✓stale
windock

[PATCH] options_for_select do not select boolean values correctly

Reported by windock | September 25th, 2010 @ 07:32 PM

options_for_select, given boolean values, do not make false selected

options_for_select([true, false], :selected => false)
=> "<option value=&quot;true&quot;>true</option>\n<option value=&quot;false&quot;>false</option>"

This has some practical value, for example, by giving option for selecting user's sex:

options_for_select({"Male" => true, "Female" => false}, :selected => false)
makes only male selected, which is I'd say, discrimination.

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

Pages