Class: VCFB::Component::CheckBox

Inherits:
Base
  • Object
show all
Defined in:
lib/vcfb/component/check_box.rb

Instance Method Summary collapse

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, options = {}, checked_value = "1", unchecked_value = "0")
  run_callbacks :initialize do
    @form = form
    @method = method
    @options = defined?(TagOptions::Hash) ? TagOptions::Hash.new(options) : options
    @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(options = {})
  check_box(@form.object_name, @method, options, @checked_value, @unchecked_value)
end