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 ?
I am very new to Rails and I am more or less only 6 months to 1 year
kid in Rails...
I just wondering with your code.. I really dont see what is
"semantic_form_for " and f.buttons?? Is it view helper that you have
written or any plugin which overrides the default form_for construct??
This would be very helpful to me in writing the more maintainable
Rails code...