I'm trying to figure out how to set the selected option of a select box generated by SimpleForm. My code is along the lines of:
<%= simple_form_for(@user) do |f| %>
<%= f.association :store, default: 1 %>
Of course the default: 1
part does not work.
TIA
Use the following:
selected: 1
You can now use the following:
<%= f.association :store, selected: 1 %>
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