I have two models store and category. A store can have many categories and should get stored in categories_stores table. The model relationships are setup properly and I have the following on the store form:
f.input :categories, :as => :check_boxes
And they do indeed display correctly. But creating or editing a store doesn’t create / delete those records in the categories_stores table.
Any ideas?
Update: The above code already generates the list correctly (see screenshot and HTML code below) — the only problem is changes to this aren’t getting saved in the DB!

<input id = "merchant_category_ids_" name="merchant[category_ids][]" type="hidden" value="" />
<ol>
<li><input id="merchant_category_ids_1" name="merchant[category_ids][]" type="checkbox" value="6" /> Clothing</li>
<li><input checked="checked" id="merchant_category_ids_2" name="merchant[category_ids][]" type="checkbox" value="5" /> Electronics</li>
</ol>
Sounds like you may be trying to set sub-resources. If that’s the case, you can try something like:
Take a look at the
fields_fordoc for more info.