Class: CollectionsController

Inherits:
CatalogController
  • Object
show all
Includes:
Blacklight::Configurable, Blacklight::SearchHelper
Defined in:
app/controllers/collections_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/collections_controller.rb', line 23

def index
  @nav_li_active = 'explore'
  (@response, @document_list) = search_results(params)
  params[:view] = 'list'
  params[:sort] = 'title_info_primary_ssort asc'

  respond_to do |format|
    format.html
  end
end

#search_action_url(options = {}) ⇒ Object

Blacklight uses #search_action_url to figure out the right URL for the global search box



18
19
20
# File 'app/controllers/collections_controller.rb', line 18

def search_action_url options = {}
  search_catalog_url(options.except(:controller, :action))
end

#showObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'app/controllers/collections_controller.rb', line 34

def show
  @nav_li_active = 'explore'
  @show_response, @document = fetch(params[:id])
  @collection_title = @document[blacklight_config.index.title_field.to_sym]

  # add params[:f] for proper facet links
  params[:f] = set_collection_facet_params(@collection_title, @document)

  # get the response for the facets representing items in collection
  (@response, @document_list) = search_results({:f => params[:f]})

  # get an image for the collection
  if @document[:exemplary_image_ssi]
    @collection_image_pid = @document[:exemplary_image_ssi]
    @collection_image_info = get_collection_image_info(@collection_image_pid,
                                                       @document[:id])
  end

  respond_to do |format|
    format.html
  end

end