This project is archived and is in readonly mode.
[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="true">true</option>\n<option value="false">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
-
windock September 25th, 2010 @ 07:46 PM
- Tag changed from action_view to action_view, patch
Patch with test attached.
-
windock September 26th, 2010 @ 12:02 PM
- Title changed from options_for_select do not select boolean values correctly to [PATCH] options_for_select do not select boolean values correctly
-
Rovetz September 30th, 2010 @ 11:53 AM
[ options.has_key?(:selected) ? options[:selected] : selected, options[:disabled]]
has space missing. Should be
[ options.has_key?(:selected) ? options[:selected] : selected, options[:disabled] ]
-
Santiago Pastorino February 2nd, 2011 @ 04:59 PM
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino February 2nd, 2011 @ 04:59 PM
- State changed from open to stale
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>