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:
- The value of
total
must be greater than zero. - 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 1400+ tech skills courses.