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
Start a free Courses trial
to watch this video
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 upRelated 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