I'd like to do something like this:
<%= f.association :productgroup, default: params[:productgroup_id] %>
The params should only be used if there is no value (lets say for new records), so selected:
is not what I'm looking for because it overrides the value when I edit the record.
Thanks, Andreas
Set the value in your controller for the form object eg
controller
view