Module: JqueryUiForm::Inputs::BooleanInput
- Included in:
- FormBuilder
- Defined in:
- lib/jquery_ui_form/inputs/boolean_input.rb
Instance Method Summary collapse
Instance Method Details
#boolean_input(method, options = {}) ⇒ Object
5 6 7 |
# File 'lib/jquery_ui_form/inputs/boolean_input.rb', line 5 def boolean_input(method, = {}) basic_input_helper(:check_box, :boolean, method, ) end |
#check_box(method, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/jquery_ui_form/inputs/boolean_input.rb', line 9 def check_box(method, = {}) checked_value = .delete(:checked_value) || "1" unchecked_value = .delete(:unchecked_value) || "0" unless [:value].nil? value = .delete(:value) if value === true [:checked] = true else [:checked] ||= value.to_s == checked_value.to_s end end super(method, ,checked_value, unchecked_value) end |