Module: Hyrax::BreadcrumbsForCollections

Extended by:
ActiveSupport::Concern
Includes:
Breadcrumbs
Included in:
CollectionsController, Dashboard::CollectionsController
Defined in:
app/controllers/concerns/hyrax/breadcrumbs_for_collections.rb

Instance Method Summary collapse

Methods included from Breadcrumbs

#build_breadcrumbs, #default_trail, #trail_from_referer

Instance Method Details

#add_breadcrumb_for_actionObject


14
15
16
17
18
19
20
21
# File 'app/controllers/concerns/hyrax/breadcrumbs_for_collections.rb', line 14

def add_breadcrumb_for_action
  case action_name
  when 'edit'.freeze
    add_breadcrumb I18n.t("hyrax.collection.browse_view"), collection_path(params["id"]), mark_active_action
  when 'show'.freeze
    add_breadcrumb presenter.to_s, polymorphic_path(presenter), mark_active_action
  end
end

#add_breadcrumb_for_controllerObject


10
11
12
# File 'app/controllers/concerns/hyrax/breadcrumbs_for_collections.rb', line 10

def add_breadcrumb_for_controller
  add_breadcrumb I18n.t('hyrax.dashboard.my.collections'), hyrax.my_collections_path
end

#mark_active_actionObject


23
24
25
# File 'app/controllers/concerns/hyrax/breadcrumbs_for_collections.rb', line 23

def mark_active_action
  { "aria-current" => "page" }
end