diff options
Diffstat (limited to 'app/helpers/breadcrumbs_helper.rb')
-rw-r--r-- | app/helpers/breadcrumbs_helper.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/helpers/breadcrumbs_helper.rb b/app/helpers/breadcrumbs_helper.rb new file mode 100644 index 00000000000..eb8df3bc1ea --- /dev/null +++ b/app/helpers/breadcrumbs_helper.rb @@ -0,0 +1,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 |