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, #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



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

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



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

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