Help with checkBoxes

I’m a little lost.

What I’m trying to do is present a form with a list of choices. First column is a checkbox to select the row, the rest of the fields are data fields from related models.

I evaluated checkboxlist but I don’t think that applies in this situation since that would provide me multiple choices for a single row - not what I want.

So, trying to use checkbox.

To make this question simpler lets assume I have Students and Classes. Students need to sign up (apply) for Classes. Naturally there is a MANY_MANY relationship.

In my form I want to present a list of Classes to the Student:




<tr>

  <th>Checkbox</th>

  <th>Class Name</th>

  <th>Teacher</th>

  <th>Room</th>

</tr>



How do I show the list of classes and have the checkboxes prechecked for the records already in the join table? I am sure this is dirt simple but I am racking my brain on this one!

Do I use checkBoxList or activeCheckBoxList?

Any help much appreciated.