Module: Releaf::Builders::FormBuilder::BooleanFields

Included in:
Fields
Defined in:
app/builders/releaf/builders/form_builder/boolean_fields.rb

Instance Method Summary collapse

Instance Method Details

#releaf_boolean_field(name, input: {}, label: {}, field: {}, options: {}) ⇒ Object


2
3
4
5
6
7
8
9
10
11
# File 'app/builders/releaf/builders/form_builder/boolean_fields.rb', line 2

def releaf_boolean_field(name, input: {}, label: {}, field: {}, options: {})
  attributes = input_attributes(name, input, options)
  options = {field: {type: "boolean"}}.deep_merge(options)

  wrapper(field_attributes(name, field, options)) do
    wrapper(class: "value") do
      check_box(name, attributes) << releaf_label(name, label, options.deep_merge(label: {minimal: true}))
    end
  end
end