Class: InnerPlan::BreadcrumbsComponent
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- InnerPlan::BreadcrumbsComponent
- Includes:
- Phlex::DeferredRender, Phlex::Rails::Helpers::LinkTo
- Defined in:
- app/components/inner_plan/breadcrumbs_component.rb
Instance Method Summary collapse
-
#initialize ⇒ BreadcrumbsComponent
constructor
A new instance of BreadcrumbsComponent.
- #template ⇒ Object
- #with_breadcrumb(active: false, &content) ⇒ Object
Constructor Details
#initialize ⇒ BreadcrumbsComponent
Returns a new instance of BreadcrumbsComponent.
6 7 8 |
# File 'app/components/inner_plan/breadcrumbs_component.rb', line 6 def initialize @breadcrumbs = [] end |
Instance Method Details
#template ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/inner_plan/breadcrumbs_component.rb', line 10 def template nav(class: 'mb-1', style: "--bs-breadcrumb-divider: '›';") { ol(class: "breadcrumb mb-0") { @breadcrumbs.each do || li(class: 'breadcrumb-item text-body-tertiary') { [:content].call } end } } end |
#with_breadcrumb(active: false, &content) ⇒ Object
22 23 24 |
# File 'app/components/inner_plan/breadcrumbs_component.rb', line 22 def (active: false, &content) @breadcrumbs << { active: active, content: content } end |