Class: Renalware::Renal::ProfilesController

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

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Instance Method Details

#editObject



18
19
20
21
22
23
# File 'app/controllers/renalware/renal/profiles_controller.rb', line 18

def edit
  render locals: {
    patient: patient,
    profile: find_profile
  }
end

#showObject



11
12
13
14
15
16
# File 'app/controllers/renalware/renal/profiles_controller.rb', line 11

def show
  render locals: {
    patient: patient,
    profile: find_profile
  }
end

#updateObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/renalware/renal/profiles_controller.rb', line 25

def update
  profile = find_profile

  if profile.update(profile_params)
    redirect_to patient_renal_profile_path(patient),
                notice: t(".success", model_name: "profile")
  else
    render :edit, locals: {
      patient: patient,
      profile: find_profile
    }
  end
end