I have a boolean column in my model. Say it's called isType1.
Now in my form, I would like to have a dropdown with two values (type1 if boolean is true, and type2 if boolean is false) instead of a checkbox or radio buttons.
Is that possible?
Right now I am displaying it as radio buttons:
<%= f.input :isType, :as => :radio, :label => "Type"%>
I would prefer if I had a dropdown where the user could select type1 or type2 without changing the model to a string instead of a boolean.
Thanks.
This is what I was looking for:
<%= f.input :isType,
:as => :select,
:collection => [['Type1',false],['Type2',true]],
:include_blank => false,
:label => "Type" %>