Class: UI::MenubarRadioItemComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::MenubarRadioItemComponent
- Includes:
- MenubarRadioItemBehavior
- Defined in:
- app/view_components/ui/menubar_radio_item_component.rb
Overview
RadioItemComponent - ViewComponent implementation
A radio menu item (only one can be selected).
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(value: nil, checked: false, disabled: false, classes: "", **attributes) ⇒ MenubarRadioItemComponent
constructor
A new instance of MenubarRadioItemComponent.
Methods included from MenubarRadioItemBehavior
#menubar_radio_item_classes, #menubar_radio_item_data_attributes, #menubar_radio_item_html_attributes
Constructor Details
#initialize(value: nil, checked: false, disabled: false, classes: "", **attributes) ⇒ MenubarRadioItemComponent
Returns a new instance of MenubarRadioItemComponent.
12 13 14 15 16 17 18 |
# File 'app/view_components/ui/menubar_radio_item_component.rb', line 12 def initialize(value: nil, checked: false, disabled: false, classes: "", **attributes) @value = value @checked = checked @disabled = disabled @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 |
# File 'app/view_components/ui/menubar_radio_item_component.rb', line 20 def call content_tag :div, **.deep_merge(@attributes) do render_radio_icon + content_tag(:span, content) end end |