DescriptionController: move html_safe to the view

html_safe could not work upon redirection as stated here :
https://groups.google.com/forum/#!topic/rubyonrails-core/z52zgDgUmbs
This commit is contained in:
Simon Lehericey 2017-03-30 11:17:22 +02:00
parent eb3bb63a8f
commit 4cd21580fb
2 changed files with 2 additions and 2 deletions

View file

@ -98,7 +98,7 @@ class Users::DescriptionController < UsersController
private private
def redirect_to_description_with_errors(dossier, errors) def redirect_to_description_with_errors(dossier, errors)
flash.alert = errors.join('<br>').html_safe flash.alert = errors.join('<br>')
redirect_to users_dossier_description_path(dossier_id: dossier.id) redirect_to users_dossier_description_path(dossier_id: dossier.id)
end end

View file

@ -4,4 +4,4 @@
= flash.notice = flash.notice
- if flash.alert - if flash.alert
.alert.alert-danger .alert.alert-danger
= flash.alert = flash.alert.html_safe