0

I'm trying to understand how the gem backbone-on-rails works under the hood.

My problem right now is that I don't know who is in charge of generating the code for the templates it provides.

After installing and setting it up (I'm using the plain js route, not coffeescript, but the question is the same), if I write a template file in /app/assets/templates/hello.jst, it gets "somehow" translated to the following javascript inside application.js:

(function() {
 this.JST || (this.JST = {});
 this.JST["hello"] = function(obj){ <ugly js here> };
);

But who actually does generate that code? I've browsed the sourcecode of backbone-on-rails, and could not find anything that pointed to template compilation. Is the asset pipeline capable of doing that out of the box?

4

1 回答 1

0

好的,我想我找到了答案。

该功能由 sprokets 提供,对其自述文件有很好的解释

过两天就关了。

于 2013-04-12T11:22:28.153 回答