Learn to generate a migration template from the command line. Discover the important role timestamps play in migration file naming.
- [Instructor] Now that we understand what migrations are…and why they're helpful, let's create our first migration.…The way that we generate a migration is…by using the rails generate command, which we saw earlier…when we generated a controller.…But this time we're going to do rails generate and then…migration, followed by the name of the migration…that we want to create, written in camelCase.…That's where all the letters are smashed together…but we use uppercase letters to indicate…the division between words.…You want to do this from the root of your Rails application…so we'll type rails generate migration.…
And let's call this first migration DoNothingYet.…We'll hit return…and it will create a migration file for us.…Notice that migrations reside in the db directory.…That's because that's the place to keep everything…related to the database.…It also creates a directory called migrate for us,…if it doesn't already exist.…And then inside, it added a new file.…It converted our DoNothingYet in camelCase to…underscore: do_nothing_yet.…
- 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.