Validating the Order Model

Add validation rules for the Order model in the application.

We'll cover the following

We want to validate two things for the Order model:

  1. The value of total must be greater than zero.
  2. The parameter total cannot be empty.

These validation rules are added to the model by adding the code in app/models/order.rb.

Get hands-on with 1200+ tech skills courses.