Method: Forma::BooleanField#edit_element
- Defined in:
- lib/forma/field.rb
#edit_element(val) ⇒ Object
375 376 377 378 379 |
# File 'lib/forma/field.rb', line 375 def edit_element(val) e1 = el('input', attrs: { type: 'hidden', name: parameter_name, value: "0"}) e2 = el('input', attrs: { id: self.id, type: 'checkbox', name: parameter_name, checked: ('checked' if val), value: "1"}) el('span', children: [ e1, e2 ]) end |