Module: Dbla::CollectionsHelperBehavior

Included in:
CollectionsHelper
Defined in:
app/helpers/dbla/collections_helper_behavior.rb

Instance Method Summary collapse

Instance Method Details



2
3
4
5
6
7
8
# File 'app/helpers/dbla/collections_helper_behavior.rb', line 2

def dbla_collection_link(options)
  doc = options[:document]
  type = doc['ingestType']
  title = (type.eql? 'collection') ? doc['sourceResource.title'].first : doc['sourceResource.collection.title'].first
  id = (type.eql? 'collection') ? doc['id'].first : doc['sourceResource.collection.id'].first
  link_to(title, controller: :collections, action: 'show',:id=>id)
end


9
10
11
12
13
14
15
# File 'app/helpers/dbla/collections_helper_behavior.rb', line 9

def dbla_collection_search_link(options)
  doc = options[:document]
  type = doc['ingestType']
  title = (type.eql? 'collection') ? doc['sourceResource.title'].first : doc['sourceResource.collection.title'].first
  id = (type.eql? 'collection') ? doc['id'].first : doc['sourceResource.collection.id'].first
  link_to(title, controller: :catalog, action: 'index','f[sourceResource.collection.id][]'=>id,'q'=>'')
end