Merge pull request #2784 from aignatov-bio/ai-sci-4918-display-all-errors-on-signup

Fix error handling on registration page [SCI-4918]
This commit is contained in:
aignatov-bio 2020-08-12 09:39:21 +02:00 committed by GitHub
commit 91b8475db5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,9 +65,11 @@
<script>
(function () {
var formErrors = {};
<% resource.errors.each do |err, m| %>
formErrors["<%= err %>"] =["<%= m %>"];
<% resource.errors.as_json.each do |err, messages| %>
formErrors["<%= err %>"]=[]
<% messages.each do |message| %>
formErrors["<%= err %>"].push('<%= message %>');
<% end %>
<% end %>
$("form").renderFormErrors("user", formErrors, false);
@ -80,8 +82,11 @@
(function () {
var formErrors = {};
<% @team.errors.each do |err, m| %>
formErrors["<%= err %>"] =["<%= m %>"];
<% @team.errors.as_json.each do |err, messages| %>
formErrors["<%= err %>"]=[]
<% messages.each do |message| %>
formErrors["<%= err %>"].push('<%= message %>');
<% end %>
<% end %>
$("form").renderFormErrors('team', formErrors, false);