Class: Renalware::Patients::PrimaryCarePhysicianController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/patients/primary_care_physician_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Instance Method Details

#editObject

We come in here when

  1. We render the Add GP modal form the first time (html)

  2. After a practice has been selected and we refresh the modal form so it has the correct list of GPs in it (js)



14
15
16
17
# File 'app/controllers/renalware/patients/primary_care_physician_controller.rb', line 14

def edit
  authorize patient
  render_form
end

#updateObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/renalware/patients/primary_care_physician_controller.rb', line 19

def update
  authorize patient
  if update_patient
    redirect_to patient_path(patient), notice: "GP changed successfully"
  else
    flash[:error] = "The patient's GP was not changed"
    redirect_to patient_path(patient)
  end
end