In this movie, we discuss the naming which Rails uses for migrations, tables, and models. These names follow an standard pattern in Rails and it is important to understand the convention so that Rails is able to do a lot of the work for you without additional configuration.
- [Instructor] In this movie, we will take a closer look…at the models we generated in the last chapter.…There are some important details we need to understand.…To review, when you want to generate a model,…you go to the command line…at the root of your Rails application,…and you type rails generate model,…and then the singular name of the model…that you want, in Camel case.…For example, rails generate model Subject,…and that does a number of things for you.…It creates a migration file for you, in DB/migrate,…and it gives it a filename, which is automatically named…create underscore subjects.…
Notice that it is plural.…That file has a class name inside of CreateSubjects.…Also notice that that's plural.…Then, the table that we're going to be creating…is also going to be called subjects.…The generator will also create a file…in your models directory,…and that one will be called subject dot RB, singular.…If we look inside it, we'll see that it defines…a class name, which is Subject,…and that's going to be singular, and Camel case,…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.