has_and_belongs_to_manyのcheckbox
手強かった。
<% Category.find(:all).each do |category| -%> <input type="checkbox" id="<%= 'product_categories_' + category.id.to_s %>" name="product[category_ids][]" value="<%= category.id %>"<%= @product.categories.include?(category) ? ' checked' : ''%> /> <% end %>
全てのチェック外す事できてなかった。update_attributesする前にcategory_ids=[] (2005-11-17追記)