I'm trying to distinct data attributes to a radio buttons using simple form.
I want to render the following -
<input type="radio" name="special_feature[all_editions]" id="special_feature_all_editions_true" value="true" data-enables="edition_select">
<input type="radio" name="special_feature[all_editions]" id="special_feature_all_editions_false" value="false" data-disables="edition_select">
<%= f.input :all_editions,
as: :radio_buttons
%>
Any idea how I add the differrent data attributes?
form.radio_button(all_editions, txt, :data-data_attr => some_variable)
or
<%= f.input :all_editions,
as: :radio_buttons,
'data-data_attr' => 'some_variable'
%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With