How to give fingerprint css path in production rails 4

风格不统一 提交于 2019-11-29 07:44:21

You can use Sprockets::Rails::Helper#asset_digest_path, found here. Since you are in the controller, you have access to it with

self.class.helpers.asset_digest_path('application.css')
# => "application-7a23a105125768e41d9d24aee4553615.css"

Similarly, asset_path will yield the path to the application.css file

self.class.helpers.asset_path('application.css')
# => "/assets/application-7a23a105125768e41d9d24aee4553615.css"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!