Class: Spotlight::SitesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/spotlight/sites_controller.rb

Overview

Global site configuration

Instance Method Summary collapse

Instance Method Details

#edit ⇒ Object



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

def edit
  add_breadcrumb(t(:'spotlight.sites.home'), root_url)
  add_breadcrumb(t(:'spotlight.sites.edit.page_title'))
end

#edit_exhibits ⇒ Object



16
17
18
19
# File 'app/controllers/spotlight/sites_controller.rb', line 16

def edit_exhibits
  add_breadcrumb(t(:'spotlight.sites.home'), root_url)
  add_breadcrumb(t(:'spotlight.sites.edit_exhibits.page_title'))
end

#tags ⇒ Object



30
31
32
33
34
35
36
# File 'app/controllers/spotlight/sites_controller.rb', line 30

def tags
  authorize! :tag, @site

  respond_to do |format|
    format.json { render json: Spotlight::Exhibit.all_tags.map(&:name) }
  end
end

#update ⇒ Object



21
22
23
24
25
26
27
28
# File 'app/controllers/spotlight/sites_controller.rb', line 21

def update
  if @site.update(site_params)
    redirect_to exhibits_path, notice: t(:'helpers.submit.site.updated', model: @site.class.model_name.human.downcase)
  else
    flash[:alert] = @site.errors.full_messages.join('<br>'.html_safe)
    render action: :edit
  end
end