Displaying 1 result from an estimated 1 matches for "scaffolidng".
Did you mean:
scaffolding
2006 Apr 24
5
Sanitising a Phone Number input
...ontroller.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
test).
Is there anyway I can do this and keep the code overhead low?
My current sanitisation method looks like this:
private
def numericalise!(*number)
for n in number.phone do
n.gsub!(/[^0-9]/, '''')
end
end
Thanks in advance for your time and hel...