質問

what is the easiest way to get an asset's digest in ralis?

for example here is the javascript file

javascript_path "jquery.js"

and I wonder what is the digest for this jquery.js

役に立ちましたか?

解決

You can use the environment object exposed at Rails.application.assets to get more information about your assets, as in:

Rails.application.assets['jquery'].digest # => "a7570eab23993d2a207ddaa1b55756c6"
Rails.application.assets['jquery'].digest_path # => "jquery-a7570eab23993d2a207ddaa1b55756c6.js"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top