Class: UI::TableComponent

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

Instance Method Summary collapse

Methods included from TableBehavior

#render_table, #table_classes, #table_html_attributes

Constructor Details

#initialize(classes: "", **attributes) ⇒ TableComponent

Returns a new instance of TableComponent.



17
18
19
20
# File 'app/view_components/ui/table_component.rb', line 17

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

Instance Method Details

#callObject



22
23
24
25
26
# File 'app/view_components/ui/table_component.rb', line 22

def call
   :table, **table_html_attributes.deep_merge(@attributes) do
    safe_join([table_caption, table_header, table_body, table_footer].compact)
  end
end