Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby Sinatra主干Haml JST模板_Ruby_Backbone.js_Sinatra_Haml_Jst - Fatal编程技术网

Ruby Sinatra主干Haml JST模板

Ruby Sinatra主干Haml JST模板,ruby,backbone.js,sinatra,haml,jst,Ruby,Backbone.js,Sinatra,Haml,Jst,因此,我下载了Coffee Sinatra样板文件repo(),作为使用主干网和Sinatra的起点 我过去的很多Ruby经验都是使用Haml作为模板/标记语言的,所以我决定为repo设置Haml 我将文件views/templates/title.jst.tpl替换为views/templates/title.jst.haml,并将haml.js文件添加到js vendor文件夹中,将其指定为server.rb中的依赖项,以处理未定义的错误:haml不是一个函数错误 现在我要处理的错误是 un

因此,我下载了Coffee Sinatra样板文件repo(),作为使用主干网和Sinatra的起点

我过去的很多Ruby经验都是使用Haml作为模板/标记语言的,所以我决定为repo设置Haml

我将文件
views/templates/title.jst.tpl
替换为
views/templates/title.jst.haml
,并将haml.js文件添加到js vendor文件夹中,将其指定为server.rb中的依赖项,以处理
未定义的错误:haml不是一个函数
错误

现在我要处理的错误是

uncaughttypeerror:undefined不是指向
returnc[“templates/title”]的函数在输出的jst.js中:

(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);
  };
})();

有什么建议吗?

原来gem有问题,切换到(当前挂起的)Pull请求(
https://github.com/rstacruz/sinatra-backbone/pull/12
)修复了我遇到的错误。

javascript是
Sinatra::JSTPages
模块的结果,它将我的coffeescript模板转换成html模板供Backbone.js使用,我还没有写过。