2016-08-08 12:52:30 +02:00
|
|
|
class Backoffice::PrivateFormulairesController < ApplicationController
|
|
|
|
before_action :authenticate_gestionnaire!
|
|
|
|
|
|
|
|
def update
|
|
|
|
dossier = current_gestionnaire.dossiers.find(params[:dossier_id])
|
|
|
|
|
|
|
|
unless params[:champs].nil?
|
|
|
|
champs_service_errors = ChampsService.save_formulaire dossier.champs_private, params
|
|
|
|
|
|
|
|
if champs_service_errors.empty?
|
|
|
|
flash[:notice] = "Formulaire enregistré"
|
|
|
|
else
|
|
|
|
flash[:alert] = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'<br>' }).html_safe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
render 'backoffice/dossiers/formulaire_private', formats: :js
|
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|