format phone numbers
This commit is contained in:
parent
8f8b9afc5e
commit
a2c53ce7ea
2 changed files with 5 additions and 1 deletions
|
@ -24,4 +24,8 @@ class Champs::PhoneChamp < Champs::TextChamp
|
|||
allow_blank: true,
|
||||
message: I18n.t(:not_a_phone, scope: 'activerecord.errors.messages')
|
||||
}, unless: -> { Phonelib.valid_for_country?(value, :pf) }
|
||||
|
||||
def to_s
|
||||
value.present? ? Phonelib.parse(value).full_national : ''
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue