Class: Dima::Html::BooleanField
- Inherits:
-
SimpleField
- Object
- Element
- Field
- SimpleField
- Dima::Html::BooleanField
- Defined in:
- lib/dima/html/field.rb
Overview
Boolean field.
Instance Attribute Summary
Attributes inherited from SimpleField
#height, #klass, #lambda, #model, #name, #readonly, #width
Attributes inherited from Field
#after, #align, #before, #edit, #form, #has_errors, #hint, #label, #required, #tooltip, #url
Instance Method Summary collapse
Methods inherited from SimpleField
#<<, #>>, #empty?, #main_content_node, #readonly?
Methods inherited from Field
#after_node, #before_node, #edit?, #empty_node, #label_node, #options, #to_n, #url_node, #val, #val=, #validate, #value_node
Methods included from Init
Methods inherited from Element
Instance Method Details
#simple_value_node ⇒ Object
352 353 354 355 356 357 358 |
# File 'lib/dima/html/field.rb', line 352 def simple_value_node if self.edit? Node.new(tag: 'input', attributes: { name: "dim[#{name}]", class: 'dim-main-content dim-boolean', type: 'checkbox', checked: self.val }) else Node.new(tag: 'input', attributes: { class: 'dim-main-content dim-boolean', type: 'checkbox', checked: self.val, disabled: true }) end end |