Class: Renalware::DeathsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::DeathsController
- Includes:
- Pagy::Backend, PresenterHelper
- 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
19 20 21 22 |
# File 'app/controllers/renalware/deaths_controller.rb', line 19 def edit patient render_edit end |
#index ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/renalware/deaths_controller.rb', line 8 def index query = Patients::DeceasedPatientsQuery.new(params[:q]) pagy, patients = pagy(query.call.includes(previous_modality: :description)) patients render locals: { patients: present(patients, PatientPresenter), q: query.search, pagy: pagy } end |
#update ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/renalware/deaths_controller.rb', line 24 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 |