Class: Phlexi::Form::Components::Checkbox

Inherits:
Input show all
Defined in:
lib/phlexi/form/components/checkbox.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #field

Instance Method Summary collapse

Methods included from Phlexi::Form::Components::Concerns::ExtractsInput

#extract_input

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Phlexi::Form::Components::Base

Instance Method Details

#view_templateObject



7
8
9
10
# File 'lib/phlexi/form/components/checkbox.rb', line 7

def view_template
  input(type: :hidden, name: attributes[:name], value: @unchecked_value, autocomplete: "off", hidden: true) if include_hidden?
  input(**attributes, value: @checked_value)
end