Class: Virgo::Admin::NewslettersController

Inherits:
BaseController show all
Defined in:
app/controllers/virgo/admin/newsletters_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#authorize_admin_user, #search, #set_is_admin_view

Methods included from RenderHelper

#render_content, #with_format

Methods included from Virgo::ApplicationHelper

#action?, #admin?, #admin_access?, #admin_view?, #alerts, #base_errors, #category_timestamp, #column_timestamp, #compact_html, #controller?, #decode_html_entities, #expanded_post_url, #is_admin_view?, #page_url, #post_time_format, #post_timestamp, #production?, #redis_timestamp_key_for, #site, #site_key, #superuser?, #tabbed_param, #word_count

Instance Method Details

#changelogObject


21
22
23
# File 'app/controllers/virgo/admin/newsletters_controller.rb', line 21

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

#editObject


7
8
# File 'app/controllers/virgo/admin/newsletters_controller.rb', line 7

def edit
end

#updateObject


10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/virgo/admin/newsletters_controller.rb', line 10

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