on Rails的角模板 [英] Angular Templates on Rails

查看:178
本文介绍了on Rails的角模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了角轨的模板宝石。我有一个文件夹在我的 /应用/资产/ JavaScript的名为模板,我已经在包括它的application.js

  // = require_tree ./templates

里面的模板有一个的test.html 以文件< H1>的Hello World< / H1>

由于某些原因,的test.html 没有被发现,虽然,当我退出 $ templateCache.info()在控制台中我有(使用 app.run


  

{对象ID:模板,大小:0}



解决方案

这竟然是一个不兼容的链轮(见的这里

短的版本是:


  1. 添加宝石链轮,2.12.3您的Gemfile

  2. 运行捆绑更新链轮

I'm using the angular-rails-templates gem. I have a folder in my /app/assets/javascripts called templates and I have included it in application.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() (using app.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:

  1. Add gem 'sprockets', '2.12.3' to your Gemfile
  2. Run bundle update sprockets

这篇关于on Rails的角模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆