Sha256: e5b252235cae8b1897a592d6ef8fed2a9cc4e4a08926fe39fdd47a14b624d294

Contents?: true

Size: 1.25 KB

Versions: 39

Compression:

Stored size: 1.25 KB

Contents

class IshManager::ScheduledEmailActionsController < IshManager::ApplicationController

  before_action :set_lists

  def create
    authorize! :scheduled_emails_create, ::IshManager

    @scheduled = Office::ScheduledEmailAction.new( params[:sch].permit! )

    flag = @scheduled.save
    if flag
      flash[:notice] = 'Success'
    else
      flash[:alert] = "No luck: #{@scheduled.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
    authorize! :scheduled_emails_index, ::IshManager
    @scheduled_email_actions = ::Office::ScheduledEmailAction.all
  end

  def new
    @scheduled_email_action = ::Office::ScheduledEmailAction.new
    authorize! :scheduled_emails_new, @scheduled_email_action
  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

39 entries across 39 versions & 1 rubygems

Version Path
ish_manager-0.1.8.424 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.423 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.422 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.421 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.420 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.419 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.418 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.417 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.416 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.415 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.414 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.413 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.412 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.411 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.410 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.409 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.408 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.407 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.406 app/controllers/ish_manager/scheduled_email_actions_controller.rb
ish_manager-0.1.8.405 app/controllers/ish_manager/scheduled_email_actions_controller.rb