Sha256: 0a6267fe1ee721504ae23c8ab12ce338eaa51e775915ad4e5156073b3490c0c0

Contents?: true

Size: 730 Bytes

Versions: 40

Compression:

Stored size: 730 Bytes

Contents

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

    layout 'virgo/admin/site_settings'

    def edit
    end

    def update
      authorize! :manage, @site

      if @site.update(site_params)
        flash[:notice] = "Weekly newsletter settings successfully updated"
        redirect_to admin_newsletter_edit_path
      else
        render :edit
      end
    end

    def changelog
      @versions = @site.versions.order(created_at: :desc).page(params[:page])
    end

    private

    def set_site
      @site = Site.instance

      authorize! :manage, @site
    end

    def site_params
      params.permit(site: [:weekly_newsletter_intro_copy])[:site]
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

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