Class: Renalware::Clinical::ProfilesController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/clinical/profiles_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Methods inherited from BaseController

#patient

Instance Method Details

#editObject



16
17
18
19
# File 'app/controllers/renalware/clinical/profiles_controller.rb', line 16

def edit
  authorize patient
  render locals: { patient: patient }
end

#showObject



8
9
10
11
12
13
14
# File 'app/controllers/renalware/clinical/profiles_controller.rb', line 8

def show
  authorize patient
  render locals: {
    patient: patient,
    profile: Clinical::ProfilePresenter.new(patient: patient, params: params)
  }
end

#updateObject



21
22
23
24
25
26
27
28
29
# File 'app/controllers/renalware/clinical/profiles_controller.rb', line 21

def update
  authorize patient
  if update_patient
    redirect_to patient_clinical_profile_path(patient),
                notice: t(".success", model_name: "clinical history")
  else
    render :edit, locals: { patient: patient }
  end
end