Module: BreadcrumbsHelper

Defined in:
app/helpers/breadcrumbs_helper.rb

Instance Method Summary collapse

Instance Method Details

#add_to_breadcrumb_dropdown(link, location: :before) ⇒ Object


30
31
32
33
34
# File 'app/helpers/breadcrumbs_helper.rb', line 30

def add_to_breadcrumb_dropdown(link, location: :before)
  @breadcrumb_dropdown_links ||= {}
  @breadcrumb_dropdown_links[location] ||= []
  @breadcrumb_dropdown_links[location] << link
end

#add_to_breadcrumbs(text, link) ⇒ Object


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

def add_to_breadcrumbs(text, link)
  @breadcrumbs_extra_links ||= []
  @breadcrumbs_extra_links.push({
    text: text,
    link: link
  })
end

24
25
26
27
28
# File 'app/helpers/breadcrumbs_helper.rb', line 24

def breadcrumb_list_item(link)
   "li" do
    link + sprite_icon("angle-right", size: 8, css_class: "breadcrumbs-list-angle")
  end
end

18
19
20
21
22
# File 'app/helpers/breadcrumbs_helper.rb', line 18

def breadcrumb_title(title)
  return if defined?(@breadcrumb_title)

  @breadcrumb_title = title
end

12
13
14
15
16
# File 'app/helpers/breadcrumbs_helper.rb', line 12

def breadcrumb_title_link
  return @breadcrumb_link if @breadcrumb_link

  request.path
end