Class: Superform::Rails::Components::Checkbox
- Inherits:
-
Field
- Object
- Base
- Field
- Superform::Rails::Components::Checkbox
show all
- Defined in:
- lib/superform/rails/components/checkbox.rb
Instance Attribute Summary
Attributes inherited from Base
#dom, #field
Instance Method Summary
collapse
Methods inherited from Base
#focus, #initialize
Instance Method Details
#field_attributes ⇒ Object
13
14
15
|
# File 'lib/superform/rails/components/checkbox.rb', line 13
def field_attributes
{ id: dom.id, name: dom.name, checked: field.value }
end
|
#view_template ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/superform/rails/components/checkbox.rb', line 5
def view_template(&)
input(name: dom.name, type: :hidden, value: "0")
input(type: :checkbox, value: "1", **attributes)
end
|