Class: Spotlight::SearchConfigurationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Spotlight::SearchConfigurationsController
- Includes:
- Blacklight::SearchHelper
- Defined in:
- app/controllers/spotlight/search_configurations_controller.rb
Overview
CRUD actions for Blacklight search configuration
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, #default_url_options, #exhibit_masthead?, #exhibit_search_action_url, #exhibit_search_facet_url, #resource_masthead?, #search_action_url, #search_facet_url, #set_exhibit_locale_scope, #set_locale
Methods included from Config
#exhibit_specific_blacklight_config
Instance Method Details
#edit ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/controllers/spotlight/search_configurations_controller.rb', line 19 def edit t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit) t(:'spotlight.configuration.sidebar.search_configuration'), edit_exhibit_search_configuration_path(@exhibit) @field_metadata = Spotlight::FieldMetadata.new(current_exhibit, repository, @blacklight_configuration.blacklight_config) end |
#show ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/controllers/spotlight/search_configurations_controller.rb', line 11 def show respond_to do |format| format.json do render json: @blacklight_configuration.default_blacklight_config.view.to_h.reject { |_k, v| v.if == false }.keys end end end |
#update ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'app/controllers/spotlight/search_configurations_controller.rb', line 27 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 edit_exhibit_search_configuration_path(@exhibit) else render action: 'edit' end end |