I'm trying to add validation to the mobile number field. I don't want the user to input anything other than integers in this field. So, I used the following:
validates :mobile, numericality: { only_integer: true }
This works when I enter just the plus sign in the field and an error is promptly displayed. However, if you enter +123 or any other number immediately following the plus sign, the entry is saved without throwing an error. How do I ensure that only whole numbers are accepted?