I have a User model with a HABTM relation to a Role model and vice
versa. So There's a roles_users table that references :user and :role.
I'm using formtastic, and in the user.edit.html.erb I have a line that
outputs the roles as a multi-select list box. But the box is not
showing the roles that have been assigned to the users.
Another problem is that if I select a few roles and press the update
button, the roles are not being asssigned. I have to manually assign
roles by accessing the database.
Isn't this stuff supposed to happen automatically when you call
@user.update_attributes(params[:user]) in the user_controller ?
Thanks in advance.