Sha256: 2eac3f779e312db260761315559228eeab650dc2c6ef17a39b6b5bb4ef54403a
Contents?: true
Size: 1.06 KB
Versions: 5
Compression:
Stored size: 1.06 KB
Contents
module Spotlight ## # Global site configuration class SitesController < Spotlight::ApplicationController before_action :authenticate_user! before_action :load_site load_and_authorize_resource def edit end def edit_exhibits end 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 private def load_site @site ||= Spotlight::Site.instance end def site_params params.require(:site).permit( :title, :subtitle, masthead_attributes: masthead_params, exhibits_attributes: [:id, :weight] ) end def masthead_params [ :display, :source, :image, :remote_image_url, :document_global_id, :image_crop_x, :image_crop_y, :image_crop_w, :image_crop_h ] end end end
Version data entries
5 entries across 5 versions & 1 rubygems