Skip to Content
Phoenix Web Development
book

Phoenix Web Development

by Brandon Richey
April 2018
Beginner to intermediate content levelBeginner to intermediate
406 pages
9h 33m
English
Packt Publishing
Content preview from Phoenix Web Development

Working with validations and errors

Ecto provides a number of built-in changeset validations that we can hook into to ensure the data integrity of an application. Out of the box, Ecto provides the following validations to use (note that there are more than those listed; this is just a small sample):

  • validate_change validates the changeset against a provided function
  • validate_confirmation validates a field and the field's confirmation match (for example, password and password_confirmation)
  • validate_format validates that a field matches the specified format
  • validate_length validates that the field is the expected length
  • validate_number validates that the field has the specified numeric properties
  • validate_required validates that the field  ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Phoenix in Action

Phoenix in Action

Geoffrey Lessel
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781787284197Supplemental Content