Class: Renalware::Transplants::RegistrationsController

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

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Methods inherited from BaseController

#patient

Instance Method Details

#editObject



18
19
20
# File 'app/controllers/renalware/transplants/registrations_controller.rb', line 18

def edit
  render locals: { patient: patient, registration: registration }
end

#showObject



10
11
12
13
14
15
16
# File 'app/controllers/renalware/transplants/registrations_controller.rb', line 10

def show
  if registration.new_record?
    redirect_to edit_patient_transplants_registration_path(patient)
  else
    render locals: { patient: patient, registration: registration }
  end
end

#updateObject



22
23
24
25
26
27
28
29
30
# File 'app/controllers/renalware/transplants/registrations_controller.rb', line 22

def update
  if update_registration
    redirect_to patient_transplants_recipient_dashboard_path(patient),
                notice: t(".success", model_name: "registration")
  else
    flash.now[:error] = t(".failed", model_name: "registration")
    render :edit, locals: { patient: patient, registration: registration }
  end
end