【发布时间】:2014-07-14 11:48:24
【问题描述】:
我在 Rails 4 中使用 EJS。现在我的代码如下所示:
// in javascripts/helpers.js
function render(template_path, data) {
return JST['templates/' + template_path](data);
}
这让我可以将我的 ejs 模板放入 javascripts/templates 中,然后使用:
//This will render javascripts/templates/about/photos
render("about/photos",{ iLength: iLength })
但现在我需要将目录更改为在我的视图目录中。我的 .ejs 文件现在位于 views/stores/
中这可能吗?感谢您的帮助!
【问题讨论】:
标签: javascript ruby-on-rails ruby templates ejs