Checkbox - Dynamically assign id using for loop

Does anyone have sample ruby code on how to dynamically assign an id to
a checkbox using a for loop in the view? Also, how will I read the
values checked in the controller?

Thanks.