Module: CommonwealthVlrEngine::InstitutionsControllerBehavior

Extended by:
ActiveSupport::Concern
Includes:
Blacklight::Configurable, Blacklight::SearchHelper
Included in:
InstitutionsController
Defined in:
app/controllers/concerns/commonwealth_vlr_engine/institutions_controller_behavior.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/concerns/commonwealth_vlr_engine/institutions_controller_behavior.rb', line 19

def index
  @nav_li_active = 'explore'
  params[:per_page] = params[:per_page].presence || '50'
  (@response, @document_list) = search_results(params)
  params[:view] ||= 'list' # still need this or grid view is invoked
  params[:sort] = 'title_info_primary_ssort asc'

  respond_to do |format|
    format.html
  end
end

#range_limitObject



51
52
53
# File 'app/controllers/concerns/commonwealth_vlr_engine/institutions_controller_behavior.rb', line 51

def range_limit
  redirect_to range_limit_catalog_path(params.except('controller', 'action')) and return
end

#showObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'app/controllers/concerns/commonwealth_vlr_engine/institutions_controller_behavior.rb', line 31

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

  # get the response for collection objects
  @collex_response, @collex_documents = search_results({:f => {'active_fedora_model_suffix_ssi' => 'Collection','institution_pid_ssi' => params[:id]},:rows => 100, :sort => 'title_info_primary_ssort asc'})

  # add params[:f] for proper facet links
  params[:f] = {blacklight_config.institution_field => [@institution_title]}

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

  respond_to do |format|
    format.html
  end

end