From the course: Ruby on Rails 6 Essential Training: Models and Associations
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Validations - Ruby on Rails Tutorial
From the course: Ruby on Rails 6 Essential Training: Models and Associations
Challenge: Validations
(upbeat music) - [Narrator] It's time for another challenge assignment, and this one is on validations. For this challenge assignment, I'd like you to try and write at least five validations of your own choice. You can decide what they ought to be. You can do them inside the sample application that we have, or you can do it in one of your own projects. But, try and do at least five, just so you get a feel for it. To give you a bit of direction, in the Simple CMS application, we have a subject class and the name and the position attributes are good spots to put some validations. We also have page class with name, permalink, position and content. And the user class, with first name, last name and email. Altogether, that's nine attributes. Checking for the presence of all there would be enough to fulfill the challenge assignment, but I hope that you'll try to be a little more adventurous. After you've written them,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.