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



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

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

#add_breadcrumb_for_controllerObject



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

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

#mark_active_actionObject



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

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