Module: UI::TableCaptionBehavior

Included in:
TableCaption, TableCaptionComponent
Defined in:
app/behaviors/ui/table_caption_behavior.rb

Overview

UI::TableCaptionBehavior

Instance Method Summary collapse

Instance Method Details

#caption_classesObject



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

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

#caption_html_attributesObject



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

def caption_html_attributes
  {class: caption_classes}
end

#render_caption(&content_block) ⇒ Object



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

def render_caption(&content_block)
  all_attributes = caption_html_attributes.deep_merge(@attributes)
  (:caption, **all_attributes, &content_block)
end