<% yield %> <% stimulus_controller = 'fields--button-toggle' form ||= current_fields_form html_options ||= {} html_options[:id] ||= id_for(form, method) multiple ||= false other_options ||= {} options ||= options_for(form, method) %> <% content = render 'shared/fields/field', form: form, method: method, options: html_options, other_options: other_options do %> <% content_for :field do %>
<% options.each do |value, label| %> <% checked = form.object.send(method).is_a?(Array) ? form.object.send(method).map(&:to_s).include?(value.to_s) : form.object.send(method).to_s == value.to_s %> <% end %>
<% end %> <% end %> <%# The `-mb-1.5` is making up for the `mb-1.5` on each of the buttons. This allows them to wrap with appropriate vertical spacing. %>
<%= content %>