Class: Renalware::Transplants::DonorFollowupsController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/transplants/donor_followups_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Methods inherited from BaseController

#patient

Instance Method Details

#createObject



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

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

#editObject



30
31
32
# File 'app/controllers/renalware/transplants/donor_followups_controller.rb', line 30

def edit
  render locals: { patient: patient, donor_followup: operation.followup }
end

#newObject



14
15
16
17
# File 'app/controllers/renalware/transplants/donor_followups_controller.rb', line 14

def new
  donor_followup = operation.build_followup
  render locals: { patient: patient, donor_followup: donor_followup }
end

#showObject



10
11
12
# File 'app/controllers/renalware/transplants/donor_followups_controller.rb', line 10

def show
  render locals: { patient: patient, donor_followup: operation.followup }
end

#updateObject



34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/renalware/transplants/donor_followups_controller.rb', line 34

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