Class: ViewComponent::Form::CollectionRadioButtonsComponent
- Inherits:
-
FieldComponent
- Object
- BaseComponent
- FieldComponent
- ViewComponent::Form::CollectionRadioButtonsComponent
- Includes:
- ElementProc
- Defined in:
- app/components/view_component/form/collection_radio_buttons_component.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
-
#text_method ⇒ Object
readonly
Returns the value of attribute text_method.
-
#value_method ⇒ Object
readonly
Returns the value of attribute value_method.
Attributes included from ElementProc
Attributes inherited from FieldComponent
Attributes inherited from BaseComponent
Instance Method Summary collapse
-
#call ⇒ Object
rubocop:disable Metrics/MethodLength.
-
#initialize(form, object_name, method_name, collection, value_method, text_method, options = {}, html_options = {}) ⇒ CollectionRadioButtonsComponent
constructor
rubocop:disable Metrics/ParameterLists.
Methods inherited from FieldComponent
#label_text, #method_errors, #method_errors?, #object_method_names, #optional?, #required?, #validators, #value
Methods inherited from BaseComponent
#html_class, #object_errors, #object_errors?
Methods included from ClassNamesHelper
#build_tag_values, #class_names
Constructor Details
#initialize(form, object_name, method_name, collection, value_method, text_method, options = {}, html_options = {}) ⇒ CollectionRadioButtonsComponent
rubocop:disable Metrics/ParameterLists
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/components/view_component/form/collection_radio_buttons_component.rb', line 10 def initialize( # rubocop:disable Metrics/ParameterLists form, object_name, method_name, collection, value_method, text_method, = {}, = {} ) @collection = collection @value_method = value_method @text_method = text_method @html_options = super(form, object_name, method_name, ) end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
8 9 10 |
# File 'app/components/view_component/form/collection_radio_buttons_component.rb', line 8 def collection @collection end |
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
8 9 10 |
# File 'app/components/view_component/form/collection_radio_buttons_component.rb', line 8 def @html_options end |
#text_method ⇒ Object (readonly)
Returns the value of attribute text_method.
8 9 10 |
# File 'app/components/view_component/form/collection_radio_buttons_component.rb', line 8 def text_method @text_method end |
#value_method ⇒ Object (readonly)
Returns the value of attribute value_method.
8 9 10 |
# File 'app/components/view_component/form/collection_radio_buttons_component.rb', line 8 def value_method @value_method end |
Instance Method Details
#call ⇒ Object
rubocop:disable Metrics/MethodLength
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/components/view_component/form/collection_radio_buttons_component.rb', line 30 def call # rubocop:disable Metrics/MethodLength ActionView::Helpers::Tags::CollectionRadioButtons.new( object_name, method_name, @view_context, collection, value_method, text_method, , , &content ).render(&element_proc) end |