因此,我下载了Coffee样板回购(https://github.com/timwingfield/backbone-sinatra-boilerplate),作为与主干和辛纳屈玩的起点。
在我过去的Ruby经验中,我使用了Haml作为模板/标记语言,所以我决定为回购设置Haml。
我将文件views/templates/title.jst.tpl替换为views/templates/title.jst.haml,并将haml.js文件添加到js供应商文件夹中,将其指定为server.rb中的依赖项,以处理undefined: Haml is not a function错误。
现在我要处理的错误是
Uncaught TypeError: undefined is not a function指向输出的jst.js中的return c["templates/title"].apply(this, arguments);:
(function(){
var c = {};
if (!window.JST) window.JST = {};
JST["templates/title"] = function() {
if (!c["templates/title"]) c["templates/title"] = (Haml.compile("%h2 My Blog\n"));
return c["templates/title"].apply(this, arguments);
};
})();有什么建议吗?
发布于 2014-06-22 19:01:59
原来,gem有一个问题,切换到(当前挂起的)拉请求(https://github.com/rstacruz/sinatra-backbone/pull/12)修复了我得到的错误。
https://stackoverflow.com/questions/24353054
复制相似问题