简体   繁体   English

如何配置Rails 3资产管道只是将所有应用程序/资产内容复制到生产中的公共/资产?

[英]How to configure Rails 3 assets pipeline to just copy all app/assets contents to public/assets in production?

I need from my Rails 3 app just to copy the dir and file tree structure from app/assets to public/assets, flattened (all images, javascripts etc. must go just to public/assets, maintaining their subfolder structure). 我需要从我的Rails 3应用程序中将dir和文件树结构从app / assets复制到public / assets,flattened(所有图像,javascripts等必须只是公共/资产,维护它们的子文件夹结构)。 Don't ask me why. 不要问我为什么。

I don't want merging CSS and JS files into a single files, don't want digests, don't want compression. 我不想将CSS和JS文件合并到单个文件中,不想要摘要,不想压缩。

Thanks. 谢谢。

What you want to do isn't to configure the asset pipeline; 你想要做的是不配置资产管道; it's to disable it. 这是禁用它。

You can do this by setting config.assets.enabled = false in your config/application.rb . 您可以通过在config/application.rb设置config.assets.enabled = false来完成此操作。

Then instead of putting all of your assets in app/assets , just put them in public and refer to them as normal. 然后,不要将所有资产都放在app/assets ,而是将它们public并正常引用它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM