Understanding the Role of Rails Validators

In a normal Rails application, the use of validators is crucial, as they integrate with Rails form helpers and provide a similar experience to the one we provided with Angular’s form support. Given that we aren’t using Rails views, where do validators fit it?

There are a few strategies and schools of thought here, and you will need to apply some combination of them to your day-to-day features.

One school of thought is that, given the power of Postgres, there’s no need for Rails validators when using Angular for our front end. We would implement all validation on the front end, so the user gets a great experience and understands what the data should look like. We’d then use Postgres check constraints ...

Get Rails, Angular, Postgres, and Bootstrap now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.