Class: Renalware::Clinical::AllergiesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- BaseController
- Renalware::Clinical::AllergiesController
- Defined in:
- app/controllers/renalware/clinical/allergies_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/renalware/clinical/allergies_controller.rb', line 8 def create result = CreateAllergy.new(patient, current_user).call(allergy_params) do |allergy| allergy end if result.success? redirect_back fallback_location: patient_clinical_profile_path(patient), notice: success_msg_for("allergy") else # we use client-side validation so will not get here raise NotImplementedError end end |
#destroy ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/controllers/renalware/clinical/allergies_controller.rb', line 22 def destroy allergy = patient.allergies.find(params[:id]) allergy DeleteAllergy.new(allergy, current_user).call redirect_back fallback_location: patient_clinical_profile_path(patient), notice: t(".success_with_name", name: allergy.description) end |