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
-
#create ⇒ Object
rubocop:disable Metrics/AbcSize.
-
#edit ⇒ Object
rubocop:enable Metrics/AbcSize.
- #new ⇒ Object
-
#show ⇒ Object
rubocop:enable Metrics/AbcSize.
-
#update ⇒ Object
rubocop:disable Metrics/AbcSize.
Methods included from PresenterHelper
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
rubocop:disable Metrics/AbcSize
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 18 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
rubocop:enable Metrics/AbcSize
30 31 32 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 30 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
rubocop:enable Metrics/AbcSize
46 47 48 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 46 def show render locals: { pet_adequacy_result: pet_adequacy_result, patient: patient } end |
#update ⇒ Object
rubocop:disable Metrics/AbcSize
35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/renalware/pd/pet_adequacy_results_controller.rb', line 35 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 |