Sha256: a88609ea8b04f36d192b5ad9cdf79ff65c5ee5712de76ed48cb8c2983be75d5f
Contents?: true
Size: 1.02 KB
Versions: 27
Compression:
Stored size: 1.02 KB
Contents
require_dependency "renalware/clinical" module Renalware module Clinical class AllergiesController < Clinical::BaseController def create result = CreateAllergy.new(patient, current_user).call(allergy_params) do |allergy| authorize 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 def destroy allergy = patient.allergies.find(params[:id]) authorize 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 private def allergy_params params.require(:clinical_allergy).permit([:description]) end end end end
Version data entries
27 entries across 27 versions & 1 rubygems