Sha256: a3fd9e1a0141b4dbc434c246c387c744a76cda5ae4d9567881e56be18100cffe

Contents?: true

Size: 1.02 KB

Versions: 12

Compression:

Stored size: 1.02 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
    # @profiles_list = Wco::Profile.list
    @stocks_list = Iro::Stock.list
    puts! @stocks_list, '@stocks_list'
  end


end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
iron_warbler-2.0.7.22 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.21 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.20 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.19 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.18 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.17 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.16 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.15 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.14 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.13 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.12 app/controllers/iro/alerts_controller.rb
iron_warbler-2.0.7.11 app/controllers/iro/alerts_controller.rb