Module: UI::CardFooterBehavior
- Included in:
- CardFooter, CardFooterComponent
- Defined in:
- app/behaviors/ui/card_footer_behavior.rb
Overview
FooterBehavior
Shared behavior for CardFooter component across ERB, ViewComponent, and Phlex implementations.
Instance Method Summary collapse
- #card_footer_classes ⇒ Object
- #card_footer_html_attributes ⇒ Object
- #render_card_footer(&content_block) ⇒ Object
Instance Method Details
#card_footer_classes ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/behaviors/ui/card_footer_behavior.rb', line 19 def classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ , classes_value ].compact.join(" ")) end |
#card_footer_html_attributes ⇒ Object
12 13 14 15 16 17 |
# File 'app/behaviors/ui/card_footer_behavior.rb', line 12 def { class: , data: {slot: "card-footer"} } end |
#render_card_footer(&content_block) ⇒ Object
7 8 9 10 |
# File 'app/behaviors/ui/card_footer_behavior.rb', line 7 def (&content_block) all_attributes = .deep_merge(@attributes) content_tag(:div, **all_attributes, &content_block) end |