Class: VCFB::Component::CheckBox
- Defined in:
- lib/vcfb/component/check_box.rb
Instance Method Summary collapse
- #form_element(options = {}) ⇒ Object
-
#initialize(form, method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ CheckBox
constructor
A new instance of CheckBox.
Methods inherited from Base
#collection_check_boxes, #collection_radio_buttons
Constructor Details
#initialize(form, method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ CheckBox
Returns a new instance of CheckBox.
4 5 6 7 8 9 10 11 12 |
# File 'lib/vcfb/component/check_box.rb', line 4 def initialize(form, method, = {}, checked_value = "1", unchecked_value = "0") run_callbacks :initialize do @form = form @method = method @options = defined?(TagOptions::Hash) ? TagOptions::Hash.new() : @checked_value = checked_value @unchecked_value = unchecked_value end end |
Instance Method Details
#form_element(options = {}) ⇒ Object
14 15 16 |
# File 'lib/vcfb/component/check_box.rb', line 14 def form_element( = {}) check_box(@form.object_name, @method, , @checked_value, @unchecked_value) end |