app/models/address.rb
# disconnected since there's no code to display error messages yet OR matching client-side validation
disconnected since there's no code to display error messages yet OR matching client-side validation
disconnected since there ' s no code to display error messages yet OR matching client - side validation
def phone_validate
    return if phone.blank?
    n_digits = phone.scan(/[0-9]/).size
    valid_chars = (phone =~ /^[-+()\/\s\d]+$/)
    if !(n_digits > 5 && valid_chars)
      errors.add(:phone, "is invalid")
    end
  end
def phone_validate return if phone . blank? n_digits = phone . scan ( / [0-9] / ) . size valid_chars = ( phone =~ / ^[-+() \/ \s \d ]+$ / ) if ! ( n_digits > 5 && valid_chars ) errors . add ( :phone , "is invalid" ) end end
disconnected since there's no code to display error messages yet OR matching client-side validation
disconnected since there ' s no code to display error messages yet OR matching client - side validation