Options_for_select - default nil value

I have a field in a view, like so:

<%= select_tag(‘quoted_condition’,
options_for_select([‘NEW’,‘RETAIL’,‘OEM’,‘REFURB’], ‘NEW’)) %>

This sets the ‘selected’ value to ‘NEW’ - however, I would like to have
a nil value here, so I can “force” the user to choose a condition - much
likt the :prompt option for select().

Any ideas on how to do this ?


<%= select_tag(‘quoted_condition’,
options_for_select([’’,‘NEW’,‘RETAIL’,‘OEM’,‘REFURB’])) %>


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs