validates phone champ server side

This commit is contained in:
Christophe Robillard 2020-07-29 15:45:25 +02:00
parent 7faae3a438
commit 090a247ba9
4 changed files with 35 additions and 3 deletions

View file

@ -15,4 +15,10 @@
# type_de_champ_id :integer
#
class Champs::PhoneChamp < Champs::TextChamp
validates :value,
phone: {
possible: true,
allow_blank: true,
message: I18n.t(:not_a_phone, scope: 'activerecord.errors.messages')
}
end