Class: Iro::AlertsController
- Inherits:
-
ApplicationController
- Object
- Wco::ApplicationController
- ApplicationController
- Iro::AlertsController
- Defined in:
- app/controllers/iro/alerts_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/iro/alerts_controller.rb', line 6 def create @alert = Iro::Alert.new params[:alert].permit! :create, @alert if @alert.save redirect_to action: :index, notice: 'Alert was successfully created.' else render :new end end |
#destroy ⇒ Object
16 17 18 19 20 21 |
# File 'app/controllers/iro/alerts_controller.rb', line 16 def destroy @alert = Iro::Alert.find(params[:id]) :destroy, @alert @alert.destroy redirect_to action: :index, notice: 'Alert was successfully destroyed.' end |
#index ⇒ Object
23 24 25 26 |
# File 'app/controllers/iro/alerts_controller.rb', line 23 def index @alerts = Iro::Alert.all :index, Iro::Alert end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/iro/alerts_controller.rb', line 28 def update @alert = Iro::Alert.find(params[:id]) :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 |