Sha256: 32f16884b5157a65166b88445f93b9e74ab9b8cf7bc367835c22cb65dc8dbda9

Contents?: true

Size: 1.25 KB

Versions: 24

Compression:

Stored size: 1.25 KB

Contents

Sch = WcoEmail::EmailAction

class WcoEmail::EmailActionsController < WcoEmail::ApplicationController

  before_action :set_lists

  def create
    @sch = Sch.new( params[:email_action].permit! )
    authorize! :create, @sch

    flag = @sch.save
    if flag
      flash[:notice] = 'Success'
    else
      flash[:alert] = "No luck: #{@sch.errors.full_messages.join(', ')}"
    end
    redirect_to request.referrer ? request.referrer : leadsets_path
  end

  def edit
    @sch = Sch.find params[:id]
    authorize! :edit, @sch
  end

  def index
    @schs = Sch.all
    authorize! :index, @schs
  end

  def new
    @email_action = WcoEmail::EmailAction.new
    authorize! :new, @sch
  end

  def show
    @sch = Sch.find params[:id]
    authorize! :show, @sch
    redirect_to action: 'edit'
  end

  def update
    @sch = Sch.find params[:id]
    authorize! :update, @sch
    flag = @sch.update_attributes( params[:email_action].permit! )
    if flag
      flash[:notice] = "Success."
    else
      flash[:alert] = "No luck: #{@sch.errors.full_messages.join(',')}."
    end
    render action: 'edit'
  end

  ##
  ## private
  ##
  private

  def set_lists
    @email_action_templates_list = WcoEmail::EmailActionTemplate.list
    @leads_list = Wco::Lead.list
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
wco_email-0.1.1.36 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.35 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.34 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.33 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.32 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.31 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.30 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.29 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.28 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.27 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.26 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.25 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.24 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.23 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.22 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.21 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.20 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.19 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.18 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.17 app/controllers/wco_email/email_actions_controller.rb