Skip to content

[Question] Allow only phone numbers with international prefix #195

@collimarco

Description

@collimarco

I have a Rails application that allows users to enter their phone number. Users are from different countries and I don't know the country for each user.

Is it possible to force users to enter only full phone numbers that include the country code?

# example
validates :phone_number, phone: true, require_international_prefix: true

This is especially useful for Whatsapp which requires "a full phone number in international format".

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions