Sha256: 357c10b393e38e43a9bdd0934c049d9121327502d367cdd8b431a606ac898950
Contents?: true
Size: 993 Bytes
Versions: 54
Compression:
Stored size: 993 Bytes
Contents
# frozen_string_literal: true 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
54 entries across 54 versions & 1 rubygems