This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
We want our /pages path to show a list of blog pages. But right now, our view template is just showing a static header. So let's set our controller up to load some Page data so that we can include it in our template.
To run the model generator from your terminal:
bin/rails generate model ModelName attr1:type attr2:type
...Where ModelName
is the name of the model class to create (like Post
), attr1
, attr2
, etc. are the names of attributes (like title
or body
), and each type
entry is the type of the attribute (like string
or integer
).
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Daniel Bateman
13,268 Points1 Answer
-
Bradley Becker
2,317 Points0 Answers
-
Tobias Jackson
9,758 Points1 Answer
-
Danish Saleem
7,965 Pointswhy creating the controller with plural names and creating model with singular ?
Posted by Danish SaleemDanish Saleem
7,965 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up