Sha256: 870efdbfeed9389d94f3a7f36b94d42e17ab5ebda3495fae870b32bc4a460c0d

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 KB

Contents

Sch = WcoEmail::EmailAction

class WcoEmail::EmailActionsController < WcoEmail::ApplicationController

  before_action :set_lists

  def create
    @sch = Sch.new( params[:sch].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
    @sch = Sch.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[:sch].permit! )
    if flag
      flash[:notice] = "Success."
    else
      flash[:alert] = "No luck: #{@sch.errors.full_messages.join(',')}."
    end
    render action: 'edit'
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
wco_email-0.1.1.12 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.11 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.10 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.9 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.8 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.7 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.6 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.5 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.4 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.3 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.2 app/controllers/wco_email/email_actions_controller.rb
wco_email-0.1.1.1 app/controllers/wco_email/email_actions_controller.rb