I have multiple check boxes from a many to many relationship, And i'm trying to validate them so that none of the fields need a value to continue. At the moment if i try to create a user without assigning them to a group/role through the checkboxes i get

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each

Also when a group is assigned but all other fields are left empty i still get the above error.

You ruby interpreter should also be generating a line number on which this nil is happening. That should tell you what object is getting set to nil (and hence, where the problem is, and on which form element). Please post that section of code as well.
–
jeffluntJul 20 '11 at 13:02