mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 21:21:50 +08:00
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:
commit
91b8475db5
1 changed files with 10 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue