Class: Spotlight::ExhibitsController

Inherits:
ApplicationController show all
Includes:
Blacklight::SolrHelper
Defined in:
app/controllers/spotlight/exhibits_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#search_action_url

Instance Method Details

#editObject



7
8
9
10
11
12
# File 'app/controllers/spotlight/exhibits_controller.rb', line 7

def edit
  add_breadcrumb @exhibit.title, @exhibit
  add_breadcrumb t(:'spotlight.administration.sidebar.header'), exhibit_dashboard_path(@exhibit)
  add_breadcrumb t(:'spotlight.administration.sidebar.settings'), edit_exhibit_path(@exhibit)
  @exhibit.contact_emails << "" unless @exhibit.contact_emails.present?
end

#updateObject



14
15
16
17
18
19
20
# File 'app/controllers/spotlight/exhibits_controller.rb', line 14

def update
  if @exhibit.update(exhibit_params)
    redirect_to main_app.root_path, notice: "The exhibit was saved."
  else
    render action: :edit
  end
end