You shouldn't be encoding your values using inspect. That will get re-encoded into a literal string, which is probably not your intention.
The correct way to put things in your form is to do the opposite of how you want to decode them:
<%= form.text_field :group, :value => session[:id_group].join(',') %>
Where join and split are matched up properly, it will work. The counterpart to inspect is eval and you really do not want to do that as someone can run arbitrary code that way.
As a note, you can also load a bunch of users with a single query using something like:
@ids = params[:group].split(/,/)
@users = User.find_all_by_id(@ids)
This is much more efficient than loading them in one at a time.
tadman
2010-02-12 22:01:36