Module: UI::BreadcrumbLinkBehavior
- Included in:
- BreadcrumbLink, BreadcrumbLinkComponent
- Defined in:
- app/behaviors/ui/breadcrumb_link_behavior.rb
Overview
BreadcrumbLinkBehavior
Shared behavior for Breadcrumb Link component across ERB, ViewComponent, and Phlex implementations. This module provides consistent HTML attribute generation for breadcrumb links.
Instance Method Summary collapse
-
#breadcrumb_link_classes ⇒ Object
Returns combined CSS classes for the breadcrumb link.
-
#breadcrumb_link_html_attributes ⇒ Object
Returns HTML attributes for the breadcrumb link element.
Instance Method Details
#breadcrumb_link_classes ⇒ Object
Returns combined CSS classes for the breadcrumb link
18 19 20 21 22 23 24 25 |
# File 'app/behaviors/ui/breadcrumb_link_behavior.rb', line 18 def classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ , classes_value ].compact.join(" ")) end |
#breadcrumb_link_html_attributes ⇒ Object
Returns HTML attributes for the breadcrumb link element
9 10 11 12 13 14 15 |
# File 'app/behaviors/ui/breadcrumb_link_behavior.rb', line 9 def attributes_value = respond_to?(:attributes, true) ? attributes : @attributes { class: , href: @href || "#" }.merge(attributes_value || {}) end |