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