Class: ViewComponent::Form::RadioButtonComponent
- Inherits:
-
FieldComponent
- Object
- BaseComponent
- FieldComponent
- ViewComponent::Form::RadioButtonComponent
- Defined in:
- app/components/view_component/form/radio_button_component.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from FieldComponent
Attributes inherited from BaseComponent
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(form, object_name, method_name, value, options = {}) ⇒ RadioButtonComponent
constructor
A new instance of RadioButtonComponent.
Methods inherited from FieldComponent
#label_text, #method_errors, #method_errors?, #object_method_names, #optional?, #required?, #validators
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, value, options = {}) ⇒ RadioButtonComponent
Returns a new instance of RadioButtonComponent.
10 11 12 13 14 |
# File 'app/components/view_component/form/radio_button_component.rb', line 10 def initialize(form, object_name, method_name, value, = {}) @value = value super(form, object_name, method_name, ) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'app/components/view_component/form/radio_button_component.rb', line 8 def value @value end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/components/view_component/form/radio_button_component.rb', line 16 def call ActionView::Helpers::Tags::RadioButton.new( object_name, method_name, @view_context, value, ).render end |