【发布时间】:2019-01-17 08:13:57
【问题描述】:
我正在使用 Rails(4.2) + AngularJS。这里的模板分为两类,一类是直接从 config.js.erb 引用的
.when('/users', {
templateUrl: '<%= asset_path("users.html") %>',
controller: UserListCtrl
})
模板在生产中得到正确处理,并加载了用户模板的预编译版本。
从模板内部调用的其他人像
<pane ng-if="$index == 0" ng-form name="chm_standard" pane-form="details.form.routing.call_handling_mode.chm_standard" heading="{{global.chm_types[0].Description}}">
<div ng-include="'/assets/chm.html'"></div>
</pane>
开发模式下的 chm.html.erb 从 app/assets/javascripts/templates/en/chm.html 获取。 这会在生产中产生错误,“找不到模板”,因为我有
chm-fer342xx.html 在 public/assets/javascripts/templates 中
如何处理,将所有模板移动到公共/文件夹唯一选项可用吗?
【问题讨论】:
-
也许这是您的问题的答案 - stackoverflow.com/questions/12116476/…?
标签: ruby-on-rails angularjs ruby templates asset-pipeline