2018-05-24 16:40:39 +02:00
|
|
|
class DemandesController < ApplicationController
|
|
|
|
layout "new_application"
|
|
|
|
|
|
|
|
def new
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
PipedriveService.add_demande(
|
|
|
|
demande_params[:email],
|
|
|
|
demande_params[:phone],
|
|
|
|
demande_params[:name],
|
|
|
|
demande_params[:poste],
|
|
|
|
demande_params[:source],
|
|
|
|
demande_params[:organization_name],
|
2018-08-20 17:20:51 +02:00
|
|
|
demande_params[:address],
|
|
|
|
demande_params[:nb_of_procedures],
|
|
|
|
demande_params[:nb_of_dossiers],
|
|
|
|
demande_params[:deadline]
|
2018-05-24 16:40:39 +02:00
|
|
|
)
|
|
|
|
flash.notice = 'Votre demande a bien été enregistrée, nous vous contacterons rapidement.'
|
2018-11-21 15:16:35 +01:00
|
|
|
redirect_to administration_path(formulaire_demande_compte_admin_submitted: true)
|
2018-05-24 16:40:39 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def demande_params
|
2018-08-20 17:20:51 +02:00
|
|
|
params.permit(
|
|
|
|
:organization_name,
|
|
|
|
:poste,
|
|
|
|
:name,
|
|
|
|
:email,
|
|
|
|
:phone,
|
|
|
|
:source,
|
|
|
|
:address,
|
|
|
|
:nb_of_procedures,
|
|
|
|
:nb_of_dossiers,
|
|
|
|
:deadline
|
|
|
|
)
|
2018-05-24 16:40:39 +02:00
|
|
|
end
|
|
|
|
end
|