[#2258] Notify administrator of problems saving the types de champs

This commit is contained in:
Frederic Merizen 2018-09-12 10:32:10 +02:00
parent 3fea14c07d
commit b521095010

View file

@ -16,9 +16,12 @@ class Admin::TypesDeChampController < AdminController
end
def update
@procedure.update(TypesDeChampService.create_update_procedure_params params)
if @procedure.update(TypesDeChampService.create_update_procedure_params params)
flash.now.notice = 'Modifications sauvegardées'
else
flash.now.alert = @procedure.errors.full_messages.join(', ')
end
create_facade
flash.now.notice = 'Modifications sauvegardées'
render 'show', format: :js
end