Wondering if there is a way to disable only the first option in a list of options where the first option's value is nil and there are multiple options with nil values.
For example if we have
options_for_select(
[["first", nil],
["second", "second"]
["third", "third"]
["fourth", nil]])
It generates
<option name="first" value>first</option>
<option name="second" value="second">Second</option>
<option name="third" value="third">Third</option>
<option name="fourth" value>Fourth</option>
and passing in the disabled values will disable all values with nil
options_for_select(
[["first", nil],
["second", "second"]
["third", "third"]
["fourth", nil]] , :disabled=>"")
<option name="first" value disabled>first</option>
<option name="second" value="second">Second</option>
<option name="third" value="third">Third</option>
<option name="fourth" value disabled>Fourth</option>
Anyway I can specify one the first option to be disabled regardless of value? The end goal is to have
<option name="first" value disabled>first</option>
<option name="second" value="second">Second</option>
<option name="third" value="third">Third</option>
<option name="fourth" value>Fourth</option>
Aucun commentaire:
Enregistrer un commentaire