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