Class: Railsboot::BreadcrumbComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::BreadcrumbComponent
- Defined in:
- app/components/railsboot/breadcrumb_component.rb
Overview
ViewComponent: renders the breadcrumb block.
Instance Method Summary collapse
-
#initialize(wrapper_attributes: {}, **html_attributes) ⇒ BreadcrumbComponent
constructor
A new instance of BreadcrumbComponent.
Constructor Details
#initialize(wrapper_attributes: {}, **html_attributes) ⇒ BreadcrumbComponent
Returns a new instance of BreadcrumbComponent.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/railsboot/breadcrumb_component.rb', line 6 def initialize(wrapper_attributes: {}, **html_attributes) @wrapper_attributes = wrapper_attributes @html_attributes = html_attributes @html_attributes[:tag] = "nav" @html_attributes[:class] = class_names( html_attributes.delete(:class) ).presence @wrapper_attributes[:tag] = "ol" @wrapper_attributes[:class] = class_names( "breadcrumb", wrapper_attributes.delete(:class) ) end |