Module: Layered::Ui::BreadcrumbsHelper

Defined in:
app/helpers/layered/ui/breadcrumbs_helper.rb

Instance Method Summary collapse

Instance Method Details

#l_ui_breadcrumb_item(label, path = nil) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'app/helpers/layered/ui/breadcrumbs_helper.rb', line 11

def l_ui_breadcrumb_item(label, path = nil)
  (:li, class: "l-ui-breadcrumbs__item") do
    if path
      link_to(label, path, class: "l-ui-breadcrumbs__link")
    else
      (:span, label, aria: { current: "page" })
    end
  end
end

#l_ui_breadcrumbs(&block) ⇒ Object



4
5
6
7
8
9
# File 'app/helpers/layered/ui/breadcrumbs_helper.rb', line 4

def l_ui_breadcrumbs(&block)
  items = capture(&block)
  (:nav, aria: { label: "Breadcrumb" }, class: "l-ui-breadcrumbs") do
    (:ol, items, class: "l-ui-breadcrumbs__list", role: "list")
  end
end