Class: Renalware::Patients::AlertsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::Patients::AlertsController
- Defined in:
- app/controllers/renalware/patients/alerts_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST js.
-
#destroy ⇒ Object
POST js Idempotent.
-
#new ⇒ Object
GET html.
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
POST js
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/renalware/patients/alerts_controller.rb', line 16 def create alert = Alert.new(alert_params.merge!(by: user, patient: patient)) alert if alert.save render locals: { patient: patient, alert: alert } else render_form(alert, status: 422) end end |
#destroy ⇒ Object
POST js Idempotent
28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/renalware/patients/alerts_controller.rb', line 28 def destroy alert = find_alert if alert.present? alert alert.destroy render locals: { alert: alert } else head :ok end end |
#new ⇒ Object
GET html
9 10 11 12 13 |
# File 'app/controllers/renalware/patients/alerts_controller.rb', line 9 def new alert = Alert.new alert render_form(alert) end |