Class: Form::CheckboxComponent

Inherits:
InputComponent
  • Object
show all
Defined in:
app/components/spark/form/checkbox_component.rb

Direct Known Subclasses

SwitchComponent

Instance Method Summary collapse

Instance Method Details

#input_attrsObject



11
12
13
14
15
# File 'app/components/spark/form/checkbox_component.rb', line 11

def input_attrs
  tag_attrs.merge({
    type: "checkbox"
  })
end

#renderObject



5
6
7
8
9
# File 'app/components/spark/form/checkbox_component.rb', line 5

def render
  component "form/label", text: label do
    concat tag(:input, input_attrs)
  end
end