Validations Are Awesome for User Experience
Learn why validations are good for the user experience in our Rails application.
We'll cover the following...
Database constraints vs code-based validations
We’ve created a validation to constrain the maximum value of a widget’s price while writing migrations. We didn’t use the database because we decided this particular domain rule wasn’t stable and we wanted the flexibility that comes with code changes to be able to easily change it later. This won’t ensure the database contains only valid values, but it was a trade-off we made.
However, validations really shine at something else: managing the user ...