🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
  • Clint Oka
    Clint Oka
    5,768 Points

    how to post the post object

    Posted November 16, 2021 6:46pm by Clint Oka
    Clint Oka
    5,768 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Mathew McRae
    Mathew McRae
    1,613 Points

    Pass the "posts" object to your template, naming it "posts": My code: res.render('main', { posts: "#{posts}" });

    Posted June 5, 2021 7:22am by Mathew McRae
    Mathew McRae
    1,613 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Kris Thayer
    PLUS
    Kris Thayer
    Courses Plus Student 1,590 Points

    If the following variable was set in the Express app, how do you pass the posts object to your template, naming it "post

    Posted July 19, 2020 10:36pm by Kris Thayer
    Kris Thayer
    Courses Plus Student 1,590 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Matt Roberts
    Matt Roberts
    5,173 Points

    not sure if you posts as an argument with the res.render line

    Posted July 15, 2020 4:16pm by Matt Roberts
    Matt Roberts
    5,173 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    0 Answers

  • Fabian Pijpers
    PLUS
    Fabian Pijpers
    Courses Plus Student 41,372 Points

    I have tried using the , { posts: 'posts'} but that failed! Anyone?

    Posted February 11, 2020 7:25pm by Fabian Pijpers
    Fabian Pijpers
    Courses Plus Student 41,372 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    3 Answers

  • Thomas Tilton-Heylin
    Thomas Tilton-Heylin
    12,098 Points

    I cannot "Pass the posts object to your template, naming it "posts"?

    Posted July 24, 2019 3:01am by Thomas Tilton-Heylin
    Thomas Tilton-Heylin
    12,098 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    2 Answers

  • Tinashe Wesi
    Tinashe Wesi
    16,069 Points

    In the root route , render the "main.pug" template

    Posted May 21, 2019 11:56pm by Tinashe Wesi
    Tinashe Wesi
    16,069 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Shira Lotan
    Shira Lotan
    3,040 Points

    Not sure why its not working

    Posted March 11, 2019 11:39am by Shira Lotan
    Shira Lotan
    3,040 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Furkan Demirtürk
    Furkan Demirtürk
    7,940 Points

    Whats wrong?

    Posted October 31, 2018 11:33pm by Furkan Demirtürk
    Furkan Demirtürk
    7,940 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Harshay Raipancholi
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Harshay Raipancholi
    Python Development Techdegree Student 11,928 Points

    Pass the posts object to your template, naming it "posts"

    Posted September 21, 2018 2:47pm by Harshay Raipancholi
    .a{fill-rule:evenodd;}techdegree
    Harshay Raipancholi
    Python Development Techdegree Student 11,928 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Vasanth Baskaran
    Vasanth Baskaran
    4,333 Points

    Code is good, but getting error

    Posted July 14, 2018 4:07pm by Vasanth Baskaran
    Vasanth Baskaran
    4,333 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Akshit Jindal
    Akshit Jindal
    1,341 Points

    I am writing the code as said i.e res.render('main',{posts:"posts"});.

    Posted November 27, 2017 6:23pm by Akshit Jindal
    Akshit Jindal
    1,341 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Barnaby Frank
    Barnaby Frank
    3,796 Points

    hg

    Posted October 25, 2017 6:31pm by Barnaby Frank
    Barnaby Frank
    3,796 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • nico dev
    nico dev
    20,364 Points

    res.render('view',[locals]) : Not fully understanding why the string as the key and the variable as the value?

    Posted September 15, 2017 6:19am by nico dev
    nico dev
    20,364 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Kishan S
    Kishan S
    15,410 Points

    The second argument to render() needs to have the 'posts' variable as the value of its 'posts' attribute.

    Posted September 9, 2017 9:39pm by Kishan S
    Kishan S
    15,410 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Hasan Sa
    Hasan Sa
    1,929 Points

    res.render('main', {posts: ""}); what is the wrong here ?

    Posted July 29, 2017 9:31am by Hasan Sa
    Hasan Sa
    1,929 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

  • Kyle Johnson
    Kyle Johnson
    33,528 Points

    Pass the posts object to your template, naming it "posts".

    Posted July 18, 2017 6:24pm by Kyle Johnson
    Kyle Johnson
    33,528 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    6 Answers

  • Michal Krasnodebski
    Michal Krasnodebski
    7,224 Points

    Why is res.render('main', {posts: "posts"}); not correct?

    Posted July 11, 2017 10:13am by Michal Krasnodebski
    Michal Krasnodebski
    7,224 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    0 Answers

  • Andrew Young
    PLUS
    Andrew Young
    Courses Plus Student 639 Points

    Code error when rending pug with object

    Posted July 2, 2017 9:19am by Andrew Young
    Andrew Young
    Courses Plus Student 639 Points
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render

    1 Answer

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.