phony_rails
phony_rails copied to clipboard
This Gem adds useful methods to your Rails app to validate, display and save phone numbers. It uses the super awesome Phony gem (https://github.com/floere/phony).
Because `normalize_number` strips all non-phonelike characters from its input, you get weird results like the following: ``` PhonyRails.plausible_number?('https://doi.org/10.1002/rse2.195', country_code: 'GB') # => true ```
Given the number: `1 (432) 234-9838 #5426` The use of: ```ruby validates_plausible_phone :number phony_normalize :number, country_code: 'US', normalize_when_valid: true ``` will validate the number before save, then normalize it into...
On of our users insists this is a valid number for Zambia: '+260760806230' Does the gem rule need to be updated?
`#phony_normalized` cuts zero in the middle of the phone number for numbers start with 910 up to 950: ``` '9101234567'.phony_normalized #=> "911234567" '9201234567'.phony_normalized #=> "921234567" '9301234567'.phony_normalized #=> "931234567" '9401234567'.phony_normalized #=>...
This phone number should pass validation: +387-64-455-1447
phony_rails how to Determine whether the mobile number has been formatted
plausible_number? returns true for these, but they are invalid: +1 (?11) ???-???? +1 (???) ?11-???? +1 (???) 1??-???? +1 (???) 0??-???? Same for this set of 555 numbers. Every one...
For issue #180.
A perfectly valid response to this is that it's the application's responsibility, but I think it could be a nice option here. We have US & Australian users, and if...