From b69d8249c5b45910e9f42e1a7c7479af0b1bef0f Mon Sep 17 00:00:00 2001 From: Kara Diaby Date: Tue, 13 Feb 2024 07:09:58 +0000 Subject: [PATCH] controller --- app/controllers/experts/avis_controller.rb | 2 +- app/controllers/instructeurs/dossiers_controller.rb | 3 ++- app/controllers/users/dossiers_controller.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/experts/avis_controller.rb b/app/controllers/experts/avis_controller.rb index a66dec92f..14999d869 100644 --- a/app/controllers/experts/avis_controller.rb +++ b/app/controllers/experts/avis_controller.rb @@ -234,7 +234,7 @@ module Experts end def commentaire_params - params.require(:commentaire).permit(:body, :piece_jointe) + params.require(:commentaire).permit(:body, piece_jointe: []) end end end diff --git a/app/controllers/instructeurs/dossiers_controller.rb b/app/controllers/instructeurs/dossiers_controller.rb index 212a6c8b0..8063e0438 100644 --- a/app/controllers/instructeurs/dossiers_controller.rb +++ b/app/controllers/instructeurs/dossiers_controller.rb @@ -256,6 +256,7 @@ module Instructeurs flash.notice = "Message envoyé" redirect_to messagerie_instructeur_dossier_path(procedure, dossier) else + @commentaire.piece_jointe.purge.reload flash.alert = @commentaire.errors.full_messages render :messagerie end @@ -393,7 +394,7 @@ module Instructeurs end def commentaire_params - params.require(:commentaire).permit(:body, :piece_jointe) + params.require(:commentaire).permit(:body, piece_jointe: []) end def champs_private_params diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 06dd6d742..92f4d00a8 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -621,7 +621,7 @@ module Users end def commentaire_params - params.require(:commentaire).permit(:body, :piece_jointe) + params.require(:commentaire).permit(:body, piece_jointe: []) end end end