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