Marci81
7/24/2018 - 12:39 PM

Pass referenced data to the template

app.get("/campgrounds/:id", function (req, res) {


    Campground.findById(req.params.id).populate("comments").exec( function (err, foundCampground) {

        if (err) {
            console.log(err);
        } else {
            console.log(foundCampground);
            res.render("show",{campground: foundCampground});
        }

    });






});