Sha256: a834595356f37ffb037ea225a5a8b71caa413a8db91ff7faa91e0713e1807404

Contents?: true

Size: 891 Bytes

Versions: 34

Compression:

Stored size: 891 Bytes

Contents

module Virgo
  class Admin::SitesController < Admin::BaseController
    before_action :set_site

    layout 'virgo/admin/site_settings'

    def edit
    end

    def update
      if @site.update(site_params)
        flash[:notice] = "Site settings saved"
        redirect_to admin_site_edit_path
      else
        render :edit
      end
    end


    def styles
      if request.patch?
        if @site.update(site_params)
          flash[:notice] = "Site styles saved"
          redirect_to admin_site_styles_path
        else
          render :styles
        end
      end
    end

    private

    def set_site
      @site = Site.instance

      authorize! :manage, @site
    end

    def site_params
      params.permit(site: [:name, :description, :style_overrides, :tagline, :disqus_app_id, :twitter_handle, :instagram_account_name, :pinterest_account_name])[:site]
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
virgo-0.3.17 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.16 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.15 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.14 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.13 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.12 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.11 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.10 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.9 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.8 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.7 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.6 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.4 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.3 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.2 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3.1 app/controllers/virgo/admin/sites_controller.rb
virgo-0.3 app/controllers/virgo/admin/sites_controller.rb
virgo-0.2.9 app/controllers/virgo/admin/sites_controller.rb
virgo-0.2.8 app/controllers/virgo/admin/sites_controller.rb
virgo-0.2.7 app/controllers/virgo/admin/sites_controller.rb