2017-07-06 12:24:03 -04:00
|
|
|
module BreadcrumbsHelper
|
2017-07-07 16:50:34 -04:00
|
|
|
def add_to_breadcrumbs(text, link)
|
2017-07-06 12:24:03 -04:00
|
|
|
@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
|
2017-07-12 04:16:32 -04:00
|
|
|
|
|
|
|
def breadcrumb_title(title)
|
|
|
|
return if defined?(@breadcrumb_title)
|
|
|
|
|
|
|
|
@breadcrumb_title = title
|
|
|
|
end
|
2017-07-06 12:24:03 -04:00
|
|
|
end
|