Question

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

Was it helpful?

Solution

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"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top