问题
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}
回答1:
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
来源:https://stackoverflow.com/questions/29751808/angular-templates-on-rails