比如我现在有~/app/assets/templates/home.html.slim
,然后在某.js.coffee.erb
中有写:
window.App.config ['$routeProvider', ($routeProvider) ->
$routeProvider
.when '/',
templateUrl: "<%= asset_path 'home.html' %>"
]
然后很明显 Rails 找不到 home.html……
有在~/config/initializers/render.rb
中写:
Rails.application.assets.register_engine('.slim', Slim::Template)
Rails.application.assets.context_class.class_eval do
include ActionView::Helpers
include Rails.application.routes.url_helpers
end
但依然找不到……求大大帮助…………