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 »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

People watching this ticket

Attachments

Pages