After learning the syntax of the data validation methods, add validations to the simple_cms project. Start by considering what good data should look like and any database or application restrictions.
- [Instructor] In the previous movie,…we learned about Rail's built-in validations.…Now, in this movie, we're gonna add validations…to our simple CMS project.…The first question is, what should we be validating?…And to answer this, we need to answer…a couple of different questions.…What are your data concerns?…You need to think about what good data…and what bad data looks like.…You also should think about the database…that you've created.…What kinds of restrictions does the database impose…on that data?…For example, are there certain field types…that are required?…Certain links that must meet?…Is null allowed or not allowed in those database tables?…And you should ask yourself,…what would stop your application from working?…Many times, the things that are going to be validated…are a matter of personal style…and are going to be different for each and every project.…
One good way to get started…is to review the attributes of each model.…By going down the list of attributes,…it gives you a visual guide…so that you can think about the data that's going to go…
- Creating and configuring a new Ruby on Rails project
- Generating controllers and views
- Handling server requests
- Using different types of routes
- Rendering and viewing templates
- Generating migrations and models
- Creating, updating, and deleting records
- Finding records with queries
- Understanding relationship types
- Writing controllers for CRUD
- Working with layouts and helpers
- Managing application assets
- Building forms
- Validating data
- Authenticating users
Skill Level Beginner
1. What Is Ruby on Rails?
2. Get Started
3. Controllers, Views, and Dynamic Content
4. Databases and Migrations
5. Models and ActiveRecord
7. CRUD, REST, and Resourceful Routes
8. Controllers and CRUD
9. Layouts, Partials, and View Helpers
12. Data Validation
13. Controller Features
14. User Authentication
15. Improve the Simple CMS
Next steps1m 44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.