Sha256: e7f868ca06e5e45048f9e548c7f64d6cc83c5b00c57226da22188603a2339b65

Contents?: true

Size: 1.41 KB

Versions: 64

Compression:

Stored size: 1.41 KB

Contents

class ::IshManager::EmailFiltersController < ::IshManager::ApplicationController

  before_action :set_lists

  # alphabetized : )

  def create
    authorize! :create, Office::EmailFilter
    @email_filter = Office::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 = Office::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 = Office::EmailFilter.find params[:id]
    authorize! :edit, @email_filter
  end

  def index
    authorize! :index, Office::EmailFilter.new
    @email_filters = Office::EmailFilter.active
  end

  def new
    @email_filter = Office::EmailFilter.new
    authorize! :new, @email_filter
  end

  def update
    @email_filter = Office::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

end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
ish_manager-0.1.8.505 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.504 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.503 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.500 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.499 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.498 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.497 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.496 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.495 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.494 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.493 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.492 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.491 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.490 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.489 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.488 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.487 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.486 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.485 app/controllers/ish_manager/email_filters_controller.rb
ish_manager-0.1.8.484 app/controllers/ish_manager/email_filters_controller.rb