Class: UI::DropdownMenuCheckboxItemComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::DropdownMenuCheckboxItemComponent
- Includes:
- DropdownMenuCheckboxItemBehavior
- Defined in:
- app/view_components/ui/dropdown_menu_checkbox_item_component.rb
Overview
CheckboxItemComponent - ViewComponent implementation
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(checked: false, disabled: false, classes: "", **attributes) ⇒ DropdownMenuCheckboxItemComponent
constructor
A new instance of DropdownMenuCheckboxItemComponent.
Methods included from DropdownMenuCheckboxItemBehavior
#checkbox_indicator, #dropdown_menu_checkbox_item_classes, #dropdown_menu_checkbox_item_data_attributes, #dropdown_menu_checkbox_item_html_attributes
Constructor Details
#initialize(checked: false, disabled: false, classes: "", **attributes) ⇒ DropdownMenuCheckboxItemComponent
Returns a new instance of DropdownMenuCheckboxItemComponent.
7 8 9 10 11 12 |
# File 'app/view_components/ui/dropdown_menu_checkbox_item_component.rb', line 7 def initialize(checked: false, disabled: false, classes: "", **attributes) @checked = checked @disabled = disabled @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/view_components/ui/dropdown_menu_checkbox_item_component.rb', line 14 def call content_tag :div, **.merge(@attributes.except(:data)) do safe_join([ checkbox_indicator_html, content ]) end end |