[fix #728] Reduce flash error size to avoid cookies overflow
This commit is contained in:
parent
dbdb6639f3
commit
6f4ddb9e3e
3 changed files with 10 additions and 4 deletions
|
@ -100,7 +100,13 @@ class Users::DescriptionController < UsersController
|
|||
private
|
||||
|
||||
def redirect_to_description_with_errors(dossier, errors)
|
||||
flash.alert = errors
|
||||
errors_to_display = if errors.count > 3
|
||||
errors.take(3) + ['...']
|
||||
else
|
||||
errors
|
||||
end
|
||||
|
||||
flash.alert = errors_to_display
|
||||
redirect_to users_dossier_description_path(dossier_id: dossier.id)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue