Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/473.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.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
Javascript 将主干响应嵌入Rails中的下划线模板?_Javascript_Ruby On Rails_Backbone.js_Underscore.js - Fatal编程技术网

Javascript 将主干响应嵌入Rails中的下划线模板?

Javascript 将主干响应嵌入Rails中的下划线模板?,javascript,ruby-on-rails,backbone.js,underscore.js,Javascript,Ruby On Rails,Backbone.js,Underscore.js,我正在为一个rails项目使用backbone.js。我在rails视图中嵌入了一些模板,比如: <script type="text/template" id="this-is-the-id"> ... template goes here ... ... the line below this is where my error's coming from ... <%% _(<%= aNumber %>.times(function

我正在为一个rails项目使用backbone.js。我在rails视图中嵌入了一些模板,比如:

<script type="text/template" id="this-is-the-id">
    ... template goes here ...

    ... the line below this is where my error's coming from ...

    <%% _(<%= aNumber %>.times(function(){ console.log('hi'); });) %>
</script>

... 模板放在这里。。。
... 下面这行是我的错误的来源。。。

我得到了错误
未捕获的语法错误:意外标记证明我不需要在转义
中包装
一个成员,这为我修复了它。

您可能希望将其创建为一个答案并接受它,以便它不再显示在未应答列表中。