Skip to content

Commit

Permalink
Adds custom blank errors for admin user forms
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDancingClown committed Aug 2, 2023
1 parent f334638 commit 263b3e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ en:

activerecord:
errors:
full_messages:
format: "{{message}}"
messages:
blank: This field cannot be blank
blank: "%{attribute} is empty - it is a required field and must be filled in"
accepted: Must be accepted
taken: "This %{attribute} has already been taken"
too_long: "%{attribute} is too long (maximum is %{count} characters)"
Expand All @@ -71,6 +73,10 @@ en:
models:
user:
attributes:
email:
invalid: "Email is invalid - enter a valid email address"
role:
blank: "Account type is empty - it is a required field and an option should be selected from the following list"
password:
weak_password: Your new password must be more complex.
admin:
Expand Down
2 changes: 1 addition & 1 deletion spec/features/account/collaborators_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
end

within(".collaborator_email") do
expect_to_see "This field cannot be blank"
expect_to_see "Email is empty - it is a required field and must be filled in"
end
end

Expand Down

0 comments on commit 263b3e7

Please sign in to comment.