Class: Spotlight::MetadataConfigurationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/spotlight/metadata_configurations_controller.rb

Overview

CRUD actions for Blacklight metadata fields (e.g. index/show fields for various view types)

Instance Method Summary collapse

Methods included from Concerns::ApplicationController

#enabled_in_spotlight_view_type_configuration?, #field_enabled?

Methods included from Controller

#blacklight_config, #current_exhibit, #current_masthead, #current_masthead=, #current_site, #exhibit_masthead?, #exhibit_search_action_url, #exhibit_search_facet_url, #resource_masthead?, #search_action_url, #search_facet_url

Methods included from Config

#exhibit_specific_blacklight_config

Instance Method Details

#editObject



18
19
20
21
22
# File 'app/controllers/spotlight/metadata_configurations_controller.rb', line 18

def edit
  add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
  add_breadcrumb t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit)
  add_breadcrumb t(:'spotlight.configuration.sidebar.metadata'), (@exhibit)
end

#showObject



10
11
12
13
14
15
16
# File 'app/controllers/spotlight/metadata_configurations_controller.rb', line 10

def show
  respond_to do |format|
    format.json do
      render json: @blacklight_configuration.blacklight_config.index_fields.as_json
    end
  end
end

#updateObject



24
25
26
27
28
29
30
31
# File 'app/controllers/spotlight/metadata_configurations_controller.rb', line 24

def update
  if @blacklight_configuration.update(exhibit_params)
    flash[:notice] = t(:'helpers.submit.blacklight_configuration.updated', model: @blacklight_configuration.class.model_name.human.downcase)
    redirect_to (@exhibit)
  else
    render action: 'edit'
  end
end