Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 ralis 中获取资产摘要的最简单方法是什么?
例如这里是 javascript 文件
javascript_path "jquery.js"
我想知道这个的摘要是什么jquery.js
jquery.js
您可以使用公开的环境对象Rails.application.assets来获取有关您的资产的更多信息,如下所示:
Rails.application.assets
Rails.application.assets['jquery'].digest # => "a7570eab23993d2a207ddaa1b55756c6" Rails.application.assets['jquery'].digest_path # => "jquery-a7570eab23993d2a207ddaa1b55756c6.js"