This project is archived and is in readonly mode.
association_ids is not updated when all options are unselect
-
thaniyarasu
<%Role.find(:all,:select=>"id,name").each do |role|%> <%=check_box_tag name="user[role_ids][]",role.id,@user.role_ids.include?(role.id)%><%=role.name%> <%end%>
-
David Trasbo
- Assigned user set to Ryan Bigg
If you, in this example, set
role_idstonilthe join table will be updated. I think you're having this issue because therole_idsparameter will not even get sent to the controller when no check boxes are checked. It's notnil- it's undefined. This can be marked as invalid. -
Ryan Bigg
- State changed from new to invalid