Module: Hyrax::Breadcrumbs

Extended by:
ActiveSupport::Concern
Included in:
BatchEditsController, BreadcrumbsForCollections, BreadcrumbsForWorks, CitationsController, FileSetsController, StatsController
Defined in:
app/controllers/concerns/hyrax/breadcrumbs.rb

Instance Method Summary collapse

Instance Method Details

#add_breadcrumb_for_actionObject

Override these in your controller



32
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 32

def add_breadcrumb_for_action; end

#add_breadcrumb_for_controllerObject

Override these in your controller



29
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 29

def add_breadcrumb_for_controller; end

#build_breadcrumbsObject



5
6
7
8
9
10
11
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 5

def build_breadcrumbs
  if request.referer
    trail_from_referer
  else
    default_trail
  end
end

#default_trailObject



13
14
15
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 13

def default_trail
  add_breadcrumb I18n.t('hyrax.dashboard.title'), hyrax.dashboard_path if user_signed_in?
end

#trail_from_refererObject



17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/concerns/hyrax/breadcrumbs.rb', line 17

def trail_from_referer
  case request.referer
  when /catalog/
    add_breadcrumb I18n.t('hyrax.bread_crumb.search_results'), request.referer
  else
    default_trail
    add_breadcrumb_for_controller
    add_breadcrumb_for_action
  end
end