I have a table named items and three boolean columns fixed_amount, no_price, per_hour.
How can I add radio buttons of the above three columns to a form in order to submit as true if one is selected and false to rest of the columns that are not selected? I want the radio button to be able to toggle from one to another and not to select all three of them.
Currently I'm trying something like the following but without any luck:
<%= form.radio_button :no_price, '1', checked: true %>
<%= form.radio_button :fixed_amount, '1' %>
<%= form.radio_button :per_hour, '1' %>
enum pricing_option: { no_price: 0, fixed_amount: 1, per_hour: 2 }then in views:<%= collection_radio_buttons(:foo, :pricing_option, Foo.pricing_options, :first, :first)%>