【发布时间】:2013-12-03 13:46:48
【问题描述】:
我有 NodeJs:0.10.22 和 CompoundJs:1.1.7-11
我有以下控制器代码:
module.exports = Rose;
function Rose(init){
}
Rose.prototype.index = function(c){
c.send('Controller ROSE, Function Index');
};
Rose.prototype.thorne = function thorne(c){
c.send('Controller ROSE, Function Thorne');
};
我在 routes.js 文件中定义了以下路由:
exports.routes = function (map) {
map.resources('rose', function(flower){
//flower.get('thorne', '#thorne');
flower.get('thorne');
});
};
我已经在 routes.js 中尝试了 map.resources 中的两行(目前已标记,但之前已使用)。
以下网址有效:
http://localhost:3000/rose
但以下网址不起作用:
http://localhost:3000/rose/thorne
它显示以下错误:
Express
500 Error: Undefined action rose#show(/rose/thorne)
有人可以指导我做错了什么以及如何纠正它。
【问题讨论】:
标签: node.js express compoundjs