Sha256: 8a8ade8afc3ede364befc88c0ec0148c1521558f35182d3522a0b5375b92f568
Contents?: true
Size: 952 Bytes
Versions: 27
Compression:
Stored size: 952 Bytes
Contents
module Renalware class DeathsController < BaseController include PresenterHelper include Renalware::Concerns::Pageable def index patients = Patient.dead.page(page).per(per_page) authorize patients render locals: { patients: present(patients, PatientPresenter) } end def edit authorize patient render_edit end def update authorize 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 private def render_edit render :edit, locals: { patient: patient } end def death_params params .require(:patient) .permit(:died_on, :first_cause_id, :second_cause_id, :death_notes) .merge(by: current_user) end end end
Version data entries
27 entries across 27 versions & 1 rubygems