Module: UI::TableBodyBehavior

Included in:
TableBody, TableBodyComponent
Defined in:
app/behaviors/ui/table_body_behavior.rb

Overview

UI::TableBodyBehavior

Instance Method Summary collapse

Instance Method Details

#body_classesObject



22
23
24
25
26
27
# File 'app/behaviors/ui/table_body_behavior.rb', line 22

def body_classes
  TailwindMerge::Merger.new.merge([
    body_base_classes,
    @classes
  ].compact.join(" "))
end

#body_html_attributesObject



18
19
20
# File 'app/behaviors/ui/table_body_behavior.rb', line 18

def body_html_attributes
  {class: body_classes}
end

#render_body(&content_block) ⇒ Object



13
14
15
16
# File 'app/behaviors/ui/table_body_behavior.rb', line 13

def render_body(&content_block)
  all_attributes = body_html_attributes.deep_merge(@attributes)
  (:tbody, **all_attributes, &content_block)
end