【发布时间】:2019-04-03 15:20:46
【问题描述】:
//这不起作用请帮助 app.get("/dishes/:id", function(req, res){
dishes.findById(req.params.id, function(err, founddishes){
if(err){
console.log(err);
} else {
// Render show template with that campground
res.render("show", {dishes: founddishes});
}
});
});
【问题讨论】:
-
“不工作”是什么意思?你有错误吗?您是否还检查了 req.params.id 是否已填充?
-
能否请您发布一个完整的小例子,它也有同样的问题。帮助会更容易