Class: Spotlight::AppearancesController

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

Overview

Edit and update an exhibit’s appearance

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_path, #resource_masthead?, #search_action_url, #search_facet_path, #set_exhibit_locale_scope, #set_locale

Methods included from Config

#exhibit_specific_blacklight_config

Instance Method Details

#editObject



19
20
21
22
23
# File 'app/controllers/spotlight/appearances_controller.rb', line 19

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.appearance'), edit_exhibit_appearance_path(@exhibit)
end

#updateObject



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

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