Sha256: c25cad449243c9856f5c0a958c50430ad044e2c35f242460358e6ee382075617

Contents?: true

Size: 958 Bytes

Versions: 5

Compression:

Stored size: 958 Bytes

Contents

module Sufia
  module CollectionsControllerBehavior
    extend ActiveSupport::Concern
    include Sufia::Breadcrumbs

    included do
      before_action :build_breadcrumbs, only: [:edit, :show]
      layout "sufia-one-column"
      # include the link_to_remove_from_collection view helper methods
      helper CurationConcerns::CollectionsHelper
      self.presenter_class = Sufia::CollectionPresenter
      self.form_class = Sufia::Forms::CollectionForm
    end

    protected

      def add_breadcrumb_for_controller
        add_breadcrumb I18n.t('sufia.dashboard.my.collections'), sufia.dashboard_collections_path
      end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sufia-7.1.0 app/controllers/concerns/sufia/collections_controller_behavior.rb
sufia-7.0.0 app/controllers/concerns/sufia/collections_controller_behavior.rb
sufia-7.0.0.rc2 app/controllers/concerns/sufia/collections_controller_behavior.rb
sufia-7.0.0.rc1 app/controllers/concerns/sufia/collections_controller_behavior.rb
sufia-7.0.0.beta4 app/controllers/concerns/sufia/collections_controller_behavior.rb