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

#add_breadcrumb, #blacklight_config, #breadcrumbs, #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, #search_state, #set_exhibit_locale_scope, #set_locale

Methods included from Config

#exhibit_specific_blacklight_config

Instance Method Details

#editObject



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

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



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

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:
  else
    render 'edit'
  end
end