Class: UI::TableComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::TableComponent
- Includes:
- TableBehavior
- Defined in:
- app/view_components/ui/table_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ TableComponent
constructor
A new instance of TableComponent.
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
#call ⇒ Object
22 23 24 25 26 |
# File 'app/view_components/ui/table_component.rb', line 22 def call content_tag :table, **table_html_attributes.deep_merge(@attributes) do safe_join([table_caption, table_header, table_body, ].compact) end end |