Class: UI::CollapsibleContentComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
CollapsibleContentBehavior
Defined in:
app/view_components/ui/collapsible_content_component.rb

Instance Method Summary collapse

Methods included from CollapsibleContentBehavior

#collapsible_content_classes, #collapsible_content_data_attributes, #collapsible_content_html_attributes

Constructor Details

#initialize(force_mount: false, classes: "", **attributes) ⇒ CollapsibleContentComponent

Returns a new instance of CollapsibleContentComponent.



6
7
8
9
10
# File 'app/view_components/ui/collapsible_content_component.rb', line 6

def initialize(force_mount: false, classes: "", **attributes)
  @force_mount = force_mount
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#callObject



12
13
14
# File 'app/view_components/ui/collapsible_content_component.rb', line 12

def call
  (:div, content, **collapsible_content_html_attributes.deep_merge(@attributes))
end