on Rails的角模板 [英] Angular Templates on Rails
问题描述
我使用了角轨的模板
宝石。我有一个文件夹在我的 /应用/资产/ JavaScript的
名为模板
,我已经在包括它的application.js
:
// = require_tree ./templates
里面的模板有一个的test.html
以文件< H1>的Hello World< / H1>
由于某些原因,的test.html
没有被发现,虽然,当我退出 $ templateCache.info()
在控制台中我有(使用 app.run
)
{对象ID:模板,大小:0}
块引用>解决方案这竟然是一个不兼容的链轮(见的这里)
短的版本是:
- 添加
宝石链轮,2.12.3
您的Gemfile- 运行
捆绑更新链轮
I'm using the
angular-rails-templates
gem. I have a folder in my/app/assets/javascripts
calledtemplates
and I have included it inapplication.js
://= require_tree ./templates
Inside of templates there is a
test.html
file with<h1>hello world</h1>
.For some reason,
test.html
is not being found though, when I log out$templateCache.info()
(usingapp.run
) in the console I have:Object {id: "templates", size: 0}
解决方案This turned out to be a sprockets incompatibility (see here)
The short version is:
- Add
gem 'sprockets', '2.12.3'
to your Gemfile- Run
bundle update sprockets
这篇关于on Rails的角模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!