Sha256: b569e1f59d00b8836b2d888bba18ad380e5914e5857c770faedb9f2866266446
Contents?: true
Size: 1.73 KB
Versions: 142
Compression:
Stored size: 1.73 KB
Contents
# frozen_string_literal: true require_dependency "renalware/transplants/base_controller" module Renalware module Transplants class DonorFollowupsController < BaseController before_action :load_patient def show render locals: { patient: patient, donor_followup: operation.followup } end def new donor_followup = operation.build_followup render locals: { patient: patient, donor_followup: donor_followup } end def create donor_followup = operation.build_followup donor_followup.attributes = followup_attributes if donor_followup.save redirect_to patient_transplants_donor_dashboard_path(patient) else render :new, locals: { patient: patient, donor_followup: donor_followup } end end def edit render locals: { patient: patient, donor_followup: operation.followup } end def update donor_followup = operation.followup donor_followup.attributes = followup_attributes if donor_followup.save redirect_to patient_transplants_donor_dashboard_path(patient) else render :edit, locals: { patient: patient, donor_followup: donor_followup } end end protected def operation @operation ||= DonorOperation.find(params[:donor_operation_id]) end def followup_attributes params .require(:transplants_donor_followup) .permit(attributes) end def attributes [ :notes, :last_seen_on, :followed_up, :ukt_center_code, :lost_to_followup, :transferred_for_followup, :dead_on ] end end end end
Version data entries
142 entries across 142 versions & 1 rubygems