Ruby gem simple_form 3.1.0 radio button -



Ruby gem simple_form 3.1.0 radio button -

i utilize simple_form displaying radio button boolean attribute

<%= simple_form_for @model |f| %> <%= f.input :is_deleted, as: :radio_buttons %> <% end %>

but instead of 2 radio buttons yes/no titles see titles yes/no , no radio buttons. what's wrong?

edit

try this:

<%= simple_form_for @model |f| %> <%= f.input :is_deleted, as: :radio_buttons, :collection => [[true, 'yes'], [false, 'no']] %> <% end %>

obviously can substitute whatever values want display "yes" , "no"

ruby-on-rails ruby radio-button simple-form

Comments