%#
name: headmin/fields/checkbox
accepts block: no
parameters:
form: Form object
attribute: Name of the attribute of the form model
label: (bool) Label will not be displayed if value is false
%>
<% label = local_assigns.has_key?(:label) ? label : true %>
<% required = local_assigns.has_key?(:required) ? required : false %>
<%= form.check_box(
attribute,
class: "form-check-input #{form_field_validation_class(form, attribute)}",
required: required,
'aria-describedby': form_field_validation_id(form, attribute))
%>
<%= form.label attribute, class: 'form-check-label', required: required %>
<%= render 'headmin/forms/fields/validation', form: form, attribute: attribute %>