Module: UI::BreadcrumbPageBehavior
- Included in:
- BreadcrumbPage, BreadcrumbPageComponent
- Defined in:
- app/behaviors/ui/breadcrumb_page_behavior.rb
Overview
BreadcrumbPageBehavior
Shared behavior for Breadcrumb Page component across ERB, ViewComponent, and Phlex implementations. This module provides consistent HTML attribute generation for the current page indicator.
Instance Method Summary collapse
-
#breadcrumb_page_classes ⇒ Object
Returns combined CSS classes for the breadcrumb page.
-
#breadcrumb_page_html_attributes ⇒ Object
Returns HTML attributes for the breadcrumb page element.
Instance Method Details
#breadcrumb_page_classes ⇒ Object
Returns combined CSS classes for the breadcrumb page
20 21 22 23 24 25 26 27 |
# File 'app/behaviors/ui/breadcrumb_page_behavior.rb', line 20 def classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ , classes_value ].compact.join(" ")) end |
#breadcrumb_page_html_attributes ⇒ Object
Returns HTML attributes for the breadcrumb page element
9 10 11 12 13 14 15 16 17 |
# File 'app/behaviors/ui/breadcrumb_page_behavior.rb', line 9 def attributes_value = respond_to?(:attributes, true) ? attributes : @attributes { class: , role: "link", "aria-disabled": "true", "aria-current": "page" }.merge(attributes_value || {}) end |