Your select field options are being generated by this:
options_from_collection_for_select(Scale.all, :id, :name, {:selected => @miniset.scales.map(&:id)})
The selected values (id's in your case) are not supposed to be passed as a hash, but rather as an array:
options_from_collection_for_select(Scale.all, :id, :name, @miniset.scales.map(&:id))
In addition, you are passing the class
and multiple
attributes as part of the select options - but these aren't supported options, and the missing class is causing the jquery selector not to find your select field. What you want is to pass them as standard HTML options, which requires a second hash. Here's the complete select
builder that you should use:
size_fields.select :scale_id,
options_from_collection_for_select(Scale.all, :id, :name, @miniset.scales.map(&:id)),
{include_blank: ''},
{class: 'multiselect', multiple: true}