Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Practice Using Data with Pug Templates!
You have completed Practice Using Data with Pug Templates!
Preview
This video covers one solution to the Pug templates challenge.
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
Then click to a page that displays
the individual recipe information.
0:00
Now I'll show you my solution which
you can compare it to what you wrote.
0:02
You can also reference all my code
when you download the project files.
0:05
Starting with routes index.js,
0:08
the file already has access to the recipe
JSON data via the variable recipes.
0:10
So in the root get method route,
0:15
I pass the recipes data to the index
dot pug template here in res.render.
0:18
Remember the first
argument passed to res or
0:24
response .render is the file
path of the view to render.
0:27
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