Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Disha-Shah/eb8b1134d2f36bcdd24919d87d01f6cd to your computer and use it in GitHub Desktop.
Save Disha-Shah/eb8b1134d2f36bcdd24919d87d01f6cd to your computer and use it in GitHub Desktop.
Rails - Override Activerecord validation errors
activerecord:
attributes:
address:
phone: "Phone"
name: "Street Name"
line1: "Address line 1"
city: "Address line 2"
state: "State"
country: "Country"
pincode: "Pincode"
errors:
models:
address:
attributes:
phone:
blank: "is required"
not_a_number: "must be a number"
wrong_length: "must be 13 characters"
name:
blank: "is required"
line1:
blank: "is required"
city:
blank: "is required"
state:
blank: "is required"
country:
blank: "is required"
pincode:
blank: "is required"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment