Class: UI::RadioButtonComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::RadioButtonComponent
- Includes:
- RadioButtonBehavior
- Defined in:
- app/view_components/ui/radio_button_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name: nil, id: nil, value: nil, checked: false, disabled: false, required: false, classes: "", **attributes) ⇒ RadioButtonComponent
constructor
A new instance of RadioButtonComponent.
Methods included from RadioButtonBehavior
#radio_button_classes, #radio_button_data_attributes, #radio_button_html_attributes, #radio_button_id
Constructor Details
#initialize(name: nil, id: nil, value: nil, checked: false, disabled: false, required: false, classes: "", **attributes) ⇒ RadioButtonComponent
Returns a new instance of RadioButtonComponent.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/view_components/ui/radio_button_component.rb', line 6 def initialize( name: nil, id: nil, value: nil, checked: false, disabled: false, required: false, classes: "", **attributes ) @name = name @id = id @value = value @checked = checked @disabled = disabled @required = required @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/view_components/ui/radio_button_component.rb', line 26 def call content_tag :div, class: "relative inline-flex items-center justify-center" do safe_join([ content_tag(:input, nil, ), indicator_icon ]) end end |