<% label = local_assigns[:label].presence %>
<% html_options = local_assigns[:html_options] || {} %>

<div class="form-group">
  <label>
    <% if local_assigns[:form] %>
      <%= form.check_box attribute, html_options %>
    <% else %>
      <%= hidden_field_tag name, 0 %>
      <%= check_box_tag name, 1, value, html_options %>
    <% end %>
    <%= label || form.object.class.human_attribute_name(attribute) %>
  </label>
</div>
