Sha256: 5f3602e3bb2b1634ddf2e695c300ff5aee41cf0731e3ca855df9ab86ec5bc3a3
Contents?: true
Size: 1.87 KB
Versions: 2
Compression:
Stored size: 1.87 KB
Contents
class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController before_action :set_lists def create authorize! :create, WcoEmail::EmailFilter @email_filter = WcoEmail::EmailFilter.create params[:email_filter].permit! if @email_filter.persisted? flash[:notice] = 'Success' else flash[:alert] = "No luck: #{@email_filter.errors.full_messages.join(', ')}." end redirect_to action: 'index' end def destroy @email_filter = WcoEmail::EmailFilter.find params[:id] authorize! :destroy, @email_filter flag = @email_filter.destroy if flag flash[:notice] = 'Success' else flash[:alert] = 'Error' end redirect_to action: 'index' end def edit @email_filter = WcoEmail::EmailFilter.find params[:id] authorize! :edit, @email_filter end def index authorize! :index, WcoEmail::EmailFilter.new @email_filter = WcoEmail::EmailFilter.new @email_filters = WcoEmail::EmailFilter.all.includes( :email_template, :conversations ) end def new @email_filter = WcoEmail::EmailFilter.new authorize! :new, @email_filter end def show @email_filter = WcoEmail::EmailFilter.find params[:id] authorize! :show, @email_filter end def update @email_filter = WcoEmail::EmailFilter.find params[:id] authorize! :update, @email_filter flag = @email_filter.update_attributes( params[:email_filter].permit! ) if flag flash[:notice] = 'Success' else flash[:alert] = "No luck: #{@email_filter.errors.full_messages.join(', ')}." end redirect_to action: 'index' end ## ## private ## private def set_lists @tags_list = Wco::Tag.list @email_templates_list = WcoEmail::EmailTemplate.list @email_actions_list = WcoEmail::EmailAction.list @email_action_templates_list = WcoEmail::EmailActionTemplate.list end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
wco_email-0.1.1.35 | app/controllers/wco_email/email_filters_controller.rb |
wco_email-0.1.1.34 | app/controllers/wco_email/email_filters_controller.rb |