I want to sanitise a phone number input.
In my UsersController.rb file I have written a method that will take a
string and reduce it to numbers only.
This works find if I call it manually, but in the interests of keeping
DRY I would like to ensure that the code sanitisation method is called
whenever the data is edited (I’m using standard scaffolidng for this
Is there anyway I can do this and keep the code overhead low?
My current sanitisation method looks like this:
for n in number.phone do
Thanks in advance for your time and help.