empty option for select_field_view adds 2 options
Reported by mguymon | December 1st, 2008 @ 09:49 PM
The select_field_view helper is incorrectly rendering the :empty option. Only if :empty => true, 2 additional options are added to the beginning of the select:
trueIf :empty is anything but true, nothing is added.
I also was confused that the option in the help is :empty and not :empty_name, which is documented in the select_field.js
I fixed this by adding emptyValue, emptyDisabled to the select_field.js. That will be used to determine the empty option's name, value, and if it should be disabled. I added empty_name, empty_value, and empty_disabled to :select_field_view in form_views.rb to setting these values.
Comments and changes to this ticket
-
mguymon December 1st, 2008 @ 09:52 PM
html example didn't make it through.
<option value="***">true</option> <option disabled="disabled"></option>
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
SproutCore: JavaScript Application Framework
Source available from github
The Git repository resides at http://github.com/sproutit
Check out the current development trunk with:
git clone git://github.com/sproutit/sproutcore.git
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.
Submitting Patches
Resist adding new tags, use the ones in the tag cloud already. If you are submitting a patch or a pull request from a fork, tag the ticket as a "patch". If you are submitting a new feature enhancement, tag it as "enhancement". If you are submitting a fix for a bug, tag it as "fix".
Thanks!
We're glad you're contributing. Feel free to drop by the Google Group as well to let us know you are involved.
