Including assets in subdirectories with config.assets.precompile in Rails

淺唱寂寞╮ 提交于 2019-12-23 10:10:03

问题


I've got a Rails 3.1.3 application running on Heroku, utilizing S3 for asset hosting via asset_sync. Included in my app/assets/css directory is a subdirectory with two files: main.css.scss and categories.css.scss. I have the following line in my production.rb:

config.assets.precompile += [ 'admin/main.css.scss', 'admin/categories.css.scss', 'print.css', 'products.css.scss', 'services.css.scss' ]

When I push to Heroku, all my assets are precompiled and uploaded with the exception of those two files. Do I need to perform some sort of dark magic to include those two files in the process?


回答1:


Just type the filenames without scss and it will work fine.

config.assets.precompile += [ 'admin/main.css', 'admin/categories.css', 'print.css', 'products.css', 'services.css' ]


来源:https://stackoverflow.com/questions/10038867/including-assets-in-subdirectories-with-config-assets-precompile-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!