添加到 config.assets.precompile 的文件不会在开发中提供
我正在使用 activeadmin gem,它提出了一种有点奇怪的方法,将附加资产包含到 gem 自动生成的资产中: https://github.com/gregbell/active_admin/issues/492
但是我的问题是虽然在 config/application.rb 中我确实设置了
config.assets.precompile += ['active_admin.css', 'active_admin.js', 'my.css', 'my.js']
my_file.css 和 my_file.js 不在开发模式下提供服务,但这是路由错误。
我已经使用 activeadmin 自己的 config.require_javascript 和 config.require_stylesheet 注册了它们,这似乎有效,因为生成的 html 包含相应的脚本标签。
但是 /assets/my.css 和 /assets/my.css 没有响应。
什么可能会导致问题,您认为如何?
I am using the activeadmin gem which proposes a little weird way of including additional assets to those automatically generated by the gem:
https://github.com/gregbell/active_admin/issues/492
My problem however is that though in config/application.rb I do set
config.assets.precompile += ['active_admin.css', 'active_admin.js', 'my.css', 'my.js']
my_file.css and my_file.js are not served in development mode, it's Routing error.
I have registered them with the activeadmin's own config.require_javascript and config.require_stylesheet, which seems to work, since generated html contains the respective script tags.
However the /assets/my.css and /assets/my.css are not responsive.
What could cause a problem, how do you think?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,我试图添加的文件以某种方式损坏了,因为创建新文件并复制其中的内容成了一个骗局。
我包含了该插件的 .js 和 .css 文件:
http://loopj.com/jquery-tokeninput/
不考虑这个问题也没关系。
It turned out that the files I was trying to add were corrupted somehow since creating the new ones and copying the content inside made a trick.
I was including the .js and .css files of this plugin:
http://loopj.com/jquery-tokeninput/
which is fine not taking this issue into account.