Class: Renalware::PD::PETAdequacyResultsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- BaseController
- Renalware::PD::PETAdequacyResultsController
- Includes:
- PresenterHelper
- Defined in:
- app/controllers/renalware/pd/pet_adequacy_results_controller.rb
Instance Method Summary collapse
Methods included from PresenterHelper
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 17 def create result = patient.pet_adequacy_results.new(pet_adequacy_result_params) result if result.save redirect_to patient_pd_dashboard_path(patient), notice: success_msg_for("PET Adequacy") else flash.now[:error] = failed_msg_for("PET Adequacy") render :new, locals: { pet_adequacy_result: result, patient: patient } end end |
#edit ⇒ Object
28 29 30 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 28 def edit render locals: { pet_adequacy_result: pet_adequacy_result, patient: patient } end |
#new ⇒ Object
11 12 13 14 15 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 11 def new result = patient.pet_adequacy_results.new result render locals: { pet_adequacy_result: result, patient: patient } end |
#show ⇒ Object
42 43 44 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 42 def show render locals: { pet_adequacy_result: pet_adequacy_result, patient: patient } end |
#update ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 32 def update pet_adequacy_result.assign_attributes(pet_adequacy_result_params) if pet_adequacy_result.save redirect_to patient_pd_dashboard_path(patient), notice: success_msg_for("PET Adequacy") else flash.now[:error] = failed_msg_for("PET Adequacy") render :edit, locals: { pet_adequacy_result: pet_adequacy_result, patient: patient } end end |