Class: Renalware::Transplants::RecipientFollowupsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- BaseController
- Renalware::Transplants::RecipientFollowupsController
- Defined in:
- app/controllers/renalware/transplants/recipient_followups_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #edit ⇒ Object
- #new ⇒ Object
-
#show ⇒ Object
before_action :load_patient.
- #update ⇒ Object
Methods inherited from BaseController
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/renalware/transplants/recipient_followups_controller.rb', line 21 def create followup = copy_attributes_onto_followup(operation.build_followup) followup if followup.save redirect_to patient_transplants_recipient_dashboard_path(patient), notice: success_msg_for("recipient follow up") else flash.now[:error] = failed_msg_for("recipient follow up") render_new(followup) end end |
#edit ⇒ Object
33 34 35 |
# File 'app/controllers/renalware/transplants/recipient_followups_controller.rb', line 33 def edit render_edit(operation.followup) end |
#new ⇒ Object
17 18 19 |
# File 'app/controllers/renalware/transplants/recipient_followups_controller.rb', line 17 def new render_new(operation.build_followup) end |
#show ⇒ Object
before_action :load_patient
11 12 13 14 15 |
# File 'app/controllers/renalware/transplants/recipient_followups_controller.rb', line 11 def show followup = operation.followup followup render locals: { patient: patient, recipient_followup: followup } end |
#update ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/controllers/renalware/transplants/recipient_followups_controller.rb', line 37 def update followup = copy_attributes_onto_followup(operation.followup) followup if followup.save redirect_to patient_transplants_recipient_dashboard_path(patient), notice: success_msg_for("recipient follow up") else flash.now[:error] = failed_msg_for("recipient follow up") render_edit(followup) end end |