Sha256: a063decdae2a1ddcb4347d8f20606615ea11ca9698708c932c7138c4eae60c64

Contents?: true

Size: 957 Bytes

Versions: 10

Compression:

Stored size: 957 Bytes

Contents

module Hyrax
  module BreadcrumbsForWorks
    extend ActiveSupport::Concern
    include Hyrax::Breadcrumbs

    module ClassMethods
      # We don't want the breadcrumb action to occur until after the concern has
      # been loaded and authorized
      def curation_concern_type=(curation_concern_type)
        super
        before_action :build_breadcrumbs, only: [:edit, :show]
        before_action :save_permissions, only: :update
      end
    end

    def add_breadcrumb_for_controller
      add_breadcrumb I18n.t('hyrax.dashboard.my.works'), hyrax.dashboard_works_path
    end

    def add_breadcrumb_for_action
      case action_name
      when 'edit'.freeze
        add_breadcrumb curation_concern.to_s, main_app.polymorphic_path(curation_concern)
        add_breadcrumb t('hyrax.works.edit.breadcrumb'), request.path
      when 'show'.freeze
        add_breadcrumb presenter.to_s, main_app.polymorphic_path(presenter)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
hyrax-1.1.0 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
hyrax-1.0.5 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
hyrax-1.0.4 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
hyrax-1.0.3 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
hyrax-1.0.2 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
hyrax-1.0.1 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
hyrax-1.0.0.rc2 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
hyrax-1.0.0.rc1 app/controllers/concerns/hyrax/breadcrumbs_for_works.rb
test_hyrax-0.0.1.alpha app/controllers/concerns/hyrax/breadcrumbs_for_works.rb