Class: UI::MenubarCheckboxItemComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::MenubarCheckboxItemComponent
- Includes:
- MenubarCheckboxItemBehavior
- Defined in:
- app/view_components/ui/menubar_checkbox_item_component.rb
Overview
CheckboxItemComponent - ViewComponent implementation
A toggleable checkbox menu item.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(checked: false, disabled: false, classes: "", **attributes) ⇒ MenubarCheckboxItemComponent
constructor
A new instance of MenubarCheckboxItemComponent.
Methods included from MenubarCheckboxItemBehavior
#menubar_checkbox_item_classes, #menubar_checkbox_item_data_attributes, #menubar_checkbox_item_html_attributes
Constructor Details
#initialize(checked: false, disabled: false, classes: "", **attributes) ⇒ MenubarCheckboxItemComponent
Returns a new instance of MenubarCheckboxItemComponent.
12 13 14 15 16 17 |
# File 'app/view_components/ui/menubar_checkbox_item_component.rb', line 12 def initialize(checked: false, disabled: false, classes: "", **attributes) @checked = checked @disabled = disabled @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 |
# File 'app/view_components/ui/menubar_checkbox_item_component.rb', line 19 def call content_tag :div, **.deep_merge(@attributes) do render_check_icon + content_tag(:span, content) end end |