Sha256: 6475cb5bb4b902935617859b1e7335797fc8bcdfb9fec5e29e390d51e717e69e

Contents?: true

Size: 901 Bytes

Versions: 2

Compression:

Stored size: 901 Bytes

Contents

module CurationConcerns
  module UrlHelper
    # override Blacklight so we can use our 'curation_concern' namespace
    # We may also pass in a ActiveFedora document instead of a SolrDocument
    def url_for_document(doc, _options = {})
      if doc.collection?
        doc
      else
        polymorphic_path([main_app, :curation_concerns, doc])
      end
    end

    def track_collection_path(*args)
      main_app.track_solr_document_path(*args)
    end

    def track_file_set_path(*args)
      main_app.track_solr_document_path(*args)
    end

    # generated new GenericWork models get registered as curation concerns and need a
    # track_model_path to render Blacklight-related views
    CurationConcerns.config.registered_curation_concern_types.each do |concern|
      define_method("track_#{concern.underscore}_path") { |*args| main_app.track_solr_document_path(*args) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
curation_concerns-0.3.0 app/helpers/curation_concerns/url_helper.rb
curation_concerns-0.2.0 app/helpers/curation_concerns/url_helper.rb