Is there a gem that normalizes and format US phone numbers in ruby?

前端 未结 6 2058
悲哀的现实
悲哀的现实 2021-01-02 00:10

I was using phony to format phone numbers (meaning, if I put in xxx-xxx-xxxx it would convert to a string, and also tell if there is a (1) before to remove it).

But

6条回答
  •  佛祖请我去吃肉
    2021-01-02 00:47

    You could use rails number_to_phone method

    see here: http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_phone

提交回复
热议问题