#product has many and belongs to categories#products/_form.rhtml<% for category in Category.find(:all) %><%= check_box_tag "product[category_ids][]", category.id, @product.categories.include?(category) %> <%= category.name %><% end %>#products_controller.rbdef update params[:product][:category_ids] ||= [] #...end