Module: Hyrax::Breadcrumbs
- Extended by:
- ActiveSupport::Concern
- Included in:
- BatchEditsController, BreadcrumbsForCollectionAnalytics, BreadcrumbsForCollections, BreadcrumbsForWorks, BreadcrumbsForWorksAnalytics, CitationsController, DashboardController, FileSetsController, StatsController
- Defined in:
- app/controllers/concerns/hyrax/breadcrumbs.rb
Instance Method Summary collapse
-
#add_breadcrumb_for_action ⇒ Object
Override these in your controller.
-
#add_breadcrumb_for_controller ⇒ Object
Override these in your controller.
- #build_breadcrumbs ⇒ Object
- #default_trail ⇒ Object
- #trail_from_referer ⇒ Object
Instance Method Details
#add_breadcrumb_for_action ⇒ Object
Override these in your controller
37 |
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 37 def ; end |
#add_breadcrumb_for_controller ⇒ Object
Override these in your controller
34 |
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 34 def ; end |
#build_breadcrumbs ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 6 def if request.referer trail_from_referer else default_trail if user_signed_in? end end |
#default_trail ⇒ Object
16 17 18 19 |
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 16 def default_trail I18n.t('hyrax.controls.home'), hyrax.root_path I18n.t('hyrax.dashboard.title'), hyrax.dashboard_path if user_signed_in? end |
#trail_from_referer ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 21 def trail_from_referer case request.referer when /catalog/ I18n.t('hyrax.controls.home'), hyrax.root_path I18n.t('hyrax.bread_crumb.search_results'), request.referer else default_trail if user_signed_in? end end |