ruby on rails - simple_form turn boolean into dropdown with labels -
i have boolean column in model. it's called istype1.
now in form, have dropdown 2 values (type1 if boolean true, , type2 if boolean false) instead of checkbox or radio buttons.
is possible?
right displaying radio buttons:
<%= f.input :istype, :as => :radio, :label => "type"%>
i prefer if had dropdown user select type1 or type2 without changing model string instead of boolean.
thanks.
this looking for:
<%= f.input :istype, :as => :select, :collection => [['type1',false],['type2',true]], :include_blank => false, :label => "type" %>
Comments
Post a Comment