Rails config.asset.compile 设置为 false 之后,页面生成的 js 和 css 连接出错,不带有 '/assets' 前缀

tangmonk · January 26, 2016 · Last by zlx_star replied at January 26, 2016 · 1928 hits

如图:

而且直接修改 config.assets.prefix = '/assets' 也不起作用

这样的话使用 nginx 来处理这些 asset 就会有点麻烦了,以前都是用 nginx 尝试加载 public 文件夹中的文件,如果没有对应的文件的话,再把请求转发到 rails。

我记得以前版本的 rails 都默认是 'assets' 前缀,我用的 4.2.4, 我把我的这个 demo 代码放在 github,麻烦大神们帮忙看下,谢谢

https://github.com/TangMonk/rails_asset_bug

截图就不能全一点么?这么一点点

#1 楼 @huacnlee 装了个 rails_admin 的 gem 来测试

为何不用 Rails 标准的 Assets 流程呢?

You need to Sign in before reply, if you don't have an account, please Sign up first.