Sha256: 3c0a87f04da3d9466dae344f45c6faf7f28fd2a0c18f5c233fc35e6936e0c5f4

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

class Iro::AlertsController < Iro::ApplicationController

  before_action :set_lists

  def create
    @alert = Iro::Alert.new params[:alert].permit!
    authorize! :create, @alert
    if @alert.save
      redirect_to action: :index, notice: 'Alert was successfully created.'
    else
      render :new
    end
  end

  def destroy
    @alert = Iro::Alert.find(params[:id])
    authorize! :destroy, @alert
    @alert.destroy
    redirect_to action: :index, notice: 'Alert was successfully destroyed.'
  end

  def index
    @alerts = Iro::Alert.all
    authorize! :index, Iro::Alert
  end

  def update
    @alert = Iro::Alert.find(params[:id])
    authorize! :update, @alert
    if @alert.update params[:alert].permit!
      flash_notice 'ok'
    else
      flash_alert @alert
    end
    redirect_to action: :index, notice: 'Alert was successfully updated.'
  end

  ##
  ## private
  ##
  private

  def set_lists
    super

    # @profiles_list = Wco::Profile.list
    @stocks_list = Iro::Stock.list
    puts! @stocks_list, '@stocks_list'
  end


end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
iron_warbler-2.0.7.28 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.27 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.26 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.25 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.24 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.23 app/controllers/iro/alerts_controller.rb