Add more explicit message for format validation errors
This commit is contained in:
parent
47bccdb0c3
commit
fc30bf8cac
|
@ -63,7 +63,7 @@ class User < ApplicationRecord # rubocop:disable Metrics/ClassLength
|
|||
validates :email, fake_email: true, typoed_email: true
|
||||
validates :screen_name,
|
||||
presence: true,
|
||||
format: { with: SCREEN_NAME_REGEX },
|
||||
format: { with: SCREEN_NAME_REGEX, message: I18n.t("activerecord.validation.user.screen_name.format") },
|
||||
length: { minimum: 1, maximum: 16 },
|
||||
uniqueness: { case_sensitive: false },
|
||||
screen_name: true
|
||||
|
|
|
@ -96,6 +96,10 @@ en:
|
|||
primary_color: "The primary/brand colour of the site, used for navigation, links, etc."
|
||||
success_color: "Colour used for messages if something went through successfully."
|
||||
warning_color: "Colour used for warnings if something non-critical has happened."
|
||||
validation:
|
||||
user:
|
||||
screen_name:
|
||||
format: "contains invalid characters"
|
||||
helpers:
|
||||
submit:
|
||||
user:
|
||||
|
|
Loading…
Reference in New Issue