Class: VCFB::Component::RadioButton

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

Instance Method Summary collapse

Methods inherited from Base

#collection_check_boxes, #collection_radio_buttons

Constructor Details

#initialize(form, method, value, options = {}) ⇒ RadioButton

Returns a new instance of RadioButton.



4
5
6
7
8
9
10
11
# File 'lib/vcfb/component/radio_button.rb', line 4

def initialize(form, method, value, options = {})
  run_callbacks :initialize do
    @form = form
    @method = method
    @value = value
    @options = defined?(TagOptions::Hash) ? TagOptions::Hash.new(options) : options
  end
end

Instance Method Details

#form_element(options = {}) ⇒ Object



13
14
15
# File 'lib/vcfb/component/radio_button.rb', line 13

def form_element(options = {})
  radio_button(@form.object_name, @method, @value, options)
end