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

前端 未结 2 1420
渐次进展
渐次进展 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: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

提交回复
热议问题