I have a nested form categories
for stores
resource. They have a has_and_belongs_to_many relationship.
When I create the nested form, I get the following on the stores form:
But what I really want is a checklist like this:
Any ideas?
Turns out that after creating those relationships between the models, I don't need to do the f.has_many
loop in the activeadmin resource. Instead, I just needed the following to make it work:
f.input :categories, :as => :check_boxes
This will automatically take the categories and check the default ones (and also handle any changes made to it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With