ruby on rails - Apply mask to a string (phone number)? -


i want phone numbers saved db of same format. right now, it's done on front-end jquery.maskedinput plugin, , looks this:

$('input').mask('+1 (111) 111-1111') 

we're developing api, functionality has moved back-end. there way in ruby/rails number formatting simple jquery.maskedinput?i want phone numbers saved db of same format. right now, it's done on front-end "jquery.maskedinput" plugin, , looks this:

$('input').mask('+1 (111) 111-1111') 

we're developing api, functionality has moved back-end. there way in ruby/rails number formatting simple "jquery.maskedinput"?

please, take @ phone gem.

pn = phoner::phone.parse('+385915125486') pn.format("+ %c (%a) %n") # => "+ 385 (91) 5125486" 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -