Reputation: 971
I'd like to render each checkbox and label as a pair inline with the next checkbox-and-label pair on the next line.
I'm using simple_form's association method:
f.association :positions, as: :check_boxes
Is there a way to insert a tag - maybe a div - for each input-label pair? ...that can then be styled?
Upvotes: 3
Views: 3958
Reputation: 419
Just to help other people that stumble over this:
simple_form's associations
helper accepts item_wrapper_tag
and item_wrapper_class
options.
In your case, this could probably work:
f.association :positions, as: :check_boxes, item_wrapper_tag: :div, item_wrapper_class: "style_item"
how to change class of a label for checkboxes in simple_form
Upvotes: 4