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

🤑 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

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

  • 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
    • Showing results for:
    • JavaScript
    • Express Basics
    • Using Templates with Express
    • Review Response.render
    • Close
  • Clint Oka
    Clint Oka
    5,768 Points

    how to post the post object

    Posted on Nov 16, 2021 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 on Jun 5, 2021 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 on Jul 19, 2020 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 on Jul 15, 2020 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 on Feb 11, 2020 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 on Jul 24, 2019 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 on May 21, 2019 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 on Mar 11, 2019 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 on Oct 31, 2018 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,692 Points

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

    Posted on Sep 21, 2018 by Harshay Raipancholi
    .a{fill-rule:evenodd;}techdegree
    Harshay Raipancholi
    Python Development Techdegree Student 11,692 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 on Jul 14, 2018 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 on Nov 27, 2017 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 on Oct 25, 2017 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 on Sep 15, 2017 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 on Sep 9, 2017 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 on Jul 29, 2017 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 on Jul 18, 2017 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 on Jul 11, 2017 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 on Jul 2, 2017 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.