In my Users model I have
serialize :roles
Letting it default to yml
I enter roles as a text array. e.g.,
u.roles = [“member”,“scorer”]
It displays as an array
@user.roles.type returns Array
All is fine except if I try to use the select form helper to input the
values with multiple => true
I’ve tried several version and I can’t get the set values to trigger
selected in the options tag.
f.select(:roles, options_for_select(role_options,@user.roles),{},
{:multiple => true, :size => 5})
f.select(:roles, role_options,{},{:multiple => true, :size => 5})
(role_options is a helper method that return an array of valid role
options.
I had this working under 3.0, but using a kludge to put roles into a
json hash.
Steve