summaryrefslogtreecommitdiff
path: root/app/helpers/breadcrumbs_helper.rb
blob: eb8df3bc1ea38a858503b0957f8ee93cea50fa4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module BreadcrumbsHelper
  def breadcrumbs_extra_links(text, link)
    @breadcrumbs_extra_links ||= []
    @breadcrumbs_extra_links.push({
      text: text,
      link: link
    })
  end

  def breadcrumb_title_link
    return @breadcrumb_link if @breadcrumb_link

    if controller.available_action?(:index)
      url_for(action: "index")
    else
      request.path
    end
  end
end