refactor(contact): builtin piece jointe attachment

This commit is contained in:
Colin Darie 2024-07-31 16:29:45 +02:00
parent 4b6d3ee16d
commit e415c79ade
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -20,9 +20,7 @@ class ContactController < ApplicationController
return return
end end
form_params = contact_form_params @form = ContactForm.new(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.user = current_user @form.user = current_user
if @form.save if @form.save