Class: Iro::AlertsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Iro::AlertsController
- Defined in:
- app/controllers/iro/alerts_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /alerts.
-
#destroy ⇒ Object
DELETE /alerts/1.
-
#edit ⇒ Object
GET /alerts/1/edit.
-
#index ⇒ Object
GET /alerts.
-
#new ⇒ Object
GET /alerts/new.
-
#show ⇒ Object
GET /alerts/1.
-
#update ⇒ Object
PATCH/PUT /alerts/1.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
POST /alerts
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/iro/alerts_controller.rb', line 26 def create @alert = Alert.new(alert_params) if @alert.save redirect_to @alert, notice: 'Alert was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /alerts/1
46 47 48 49 |
# File 'app/controllers/iro/alerts_controller.rb', line 46 def destroy @alert.destroy redirect_to alerts_url, notice: 'Alert was successfully destroyed.' end |
#edit ⇒ Object
GET /alerts/1/edit
22 23 |
# File 'app/controllers/iro/alerts_controller.rb', line 22 def edit end |
#index ⇒ Object
GET /alerts
8 9 10 |
# File 'app/controllers/iro/alerts_controller.rb', line 8 def index @alerts = Alert.all end |
#new ⇒ Object
GET /alerts/new
17 18 19 |
# File 'app/controllers/iro/alerts_controller.rb', line 17 def new @alert = Alert.new end |
#show ⇒ Object
GET /alerts/1
13 14 |
# File 'app/controllers/iro/alerts_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /alerts/1
37 38 39 40 41 42 43 |
# File 'app/controllers/iro/alerts_controller.rb', line 37 def update if @alert.update(alert_params) redirect_to @alert, notice: 'Alert was successfully updated.' else render :edit end end |