From ee47a71e2aa87a712e4e8119887a487f5d9de806 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 31 Jul 2024 16:29:45 +0200 Subject: [PATCH] refactor(contact): builtin piece jointe attachment --- app/controllers/contact_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/contact_controller.rb b/app/controllers/contact_controller.rb index ec2805df1a9..c037f47efee 100644 --- a/app/controllers/contact_controller.rb +++ b/app/controllers/contact_controller.rb @@ -20,9 +20,7 @@ def create return end - form_params = contact_form_params - @form = ContactForm.new(form_params.except(:piece_jointe)) - @form.piece_jointe.attach(form_params[:piece_jointe]) if form_params[:piece_jointe].present? + @form = ContactForm.new(contact_form_params) @form.user = current_user if @form.save