Using Materialize in my Rails 4.2 app, and having a problem with select to show proper "selected" option after form has been saved.
I've checked logs and variable does get saved.
I've tried:
<%= f.select :state, options_for_select(apply_us_states, :selected => params[:state]) %>
and also tried
<%= f.select :state, options_for_select(apply_us_states, params[:state])%>
Select works and shows options as it should, but won't select previously saved value.
Nvm, got it sorted out.
This is what i had to do:
<%= f.select :state, apply_us_states %>
apply_us_states is a helper
hope this helps someone else
Can we see the helper you used for the options?
Most helpful comment
Nvm, got it sorted out.
This is what i had to do:
apply_us_statesis a helperhope this helps someone else