Format of EJS and JST template files in rails-backbone gem

前端 未结 2 1419
渐次进展
渐次进展 2021-02-01 04:26

I am using the rails-backbone gem ( https://github.com/codebrew/backbone-rails). For rendering HTML, it uses some kind of javascript templates, whose name I cannot tell even aft

相关标签:
2条回答
  • 2021-02-01 05:12

    A very good reference to what all this is about is here:-

    http://www.bigjason.com/blog/precompiled-javascript-templates-rails-3-1

    0 讨论(0)
  • 2021-02-01 05:14

    Rails processes EJS templates with ejs gem which is a port of underscore.js's _.template function to Ruby. Output of that is a javascript function which in turn will produce the html when run in the browser.

    • .ejs – embedded javascript
    • .jst – javascript template

    Here's recent article which includes also description of backbone-rails:

    • Where does my javascript code go? Backbone, JST and the Rails 3.1 asset pipeline
    0 讨论(0)
提交回复
热议问题