Class: Superform::Rails::Components::CheckboxComponent
Instance Attribute Summary
#dom, #field
Instance Method Summary
collapse
#focus, #initialize
Instance Method Details
#field_attributes ⇒ Object
268
269
270
|
# File 'lib/superform/rails.rb', line 268
def field_attributes
{ id: dom.id, name: dom.name, checked: field.value }
end
|
#template ⇒ Object
260
261
262
263
264
265
266
|
# File 'lib/superform/rails.rb', line 260
def template(&)
input(name: dom.name, type: :hidden, value: "0")
input(type: :checkbox, value: "1", **attributes)
end
|