Don’t know why, but cant seem to get this to work for me.
I have a phone number field for an addressbook. In the addressbook model
I have a before_update declaration that says the following:
I’d like to be able to remove all special characters (just numbers
please), but this doesn’t want to work for me.
self.phone = self.phone.to_s.gsub(/\D/, “”)
The following works to remove all numbers, so I know it’s reaching the
self.phone = self.phone.to_s.gsub(/\d/, “”)
Any help is appriciated.