rails 3.1 select multiple with serialized data

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

Happens every time - I find the problem after the post.

In the rails 3.0 version I capitalized the roles. In the rails 3.1 version I lower cased the roles.

One of the few things I hate about ruby/rails case sensitivity.

Add a before_save filter and downcase/upcase/titleize them for uniformity!

Walter