How do I make a simple form association have pre data when editing?
My form:
<h1>Editing kategori</h1>
<%= simple_form_for(@konkurrancer, :url => {:action => 'update', :id => @konkurrancer.id }) do |f| %>
<%= f.association :kategoris %>
<%= f.button :submit, :value => 'Edit konkurrence' %>
<% end %>
Your best bet is to do something like this in your controller:
Then your form should automatically populate these values as “pre data”.