Skip to content

Instantly share code, notes, and snippets.

@covard
Created June 8, 2022 17:50
Show Gist options
  • Save covard/3333ff5b5789d52bb319610fbf656523 to your computer and use it in GitHub Desktop.
Save covard/3333ff5b5789d52bb319610fbf656523 to your computer and use it in GitHub Desktop.
How to get the md5 hash part of an assets file name

Rails Assets Info

Get the asset file name including the MD5 Hash

Rails.application.assets.find_asset('some_logo_new.png').digest_path
=> "some_logo_new-65fba08ccabccb7ece3304b5b80596a26624018a41222478a9bdeab9b06e701f.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment