Sha256: 7b99f24d8c12d52f9db8078d75d9347892d8a11a0c44fb637991b096a7c6a2d2

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 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
    @symbols_list = [[nil,nil]] + Iro::Stock.active.map { |s| [ s.ticker, s.ticker ] }
  end


end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
iron_warbler-2.0.7.45 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.43 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.42 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.41 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.40 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.39 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.38 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.37 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.36 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.35 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.34 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.33 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.32 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.31 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.30 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.29 app/controllers/iro/alerts_controller.rb