Class: Renalware::DeathsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::DeathsController
- Includes:
- PresenterHelper, Concerns::Pageable
- Defined in:
- app/controllers/renalware/deaths_controller.rb
Instance Method Summary collapse
Methods included from PresenterHelper
Methods inherited from BaseController
Instance Method Details
#edit ⇒ Object
14 15 16 17 |
# File 'app/controllers/renalware/deaths_controller.rb', line 14 def edit patient render_edit end |
#index ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/renalware/deaths_controller.rb', line 8 def index patients = Patient.dead.page(page).per(per_page) patients render locals: { patients: present(patients, PatientPresenter) } end |
#update ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/renalware/deaths_controller.rb', line 19 def update patient if patient.update(death_params) redirect_to patient_clinical_profile_path(patient), notice: t(".success", model_name: "patient") else flash.now[:error] = t(".failed", model_name: "patient") render_edit end end |