Skip to content

Instantly share code, notes, and snippets.

@courtsimas
Created June 27, 2012 22:13
Show Gist options
  • Save courtsimas/3007196 to your computer and use it in GitHub Desktop.
Save courtsimas/3007196 to your computer and use it in GitHub Desktop.
grabbing a digested file when a source is passed in, when the asset_path refuses to return the digested version
def get_digest_file(source)
return asset_path(source.to_s.downcase) unless Rails.application.config.assets.digests.present?
return ActionController::Base.asset_host + "/assets/" + Rails.application.config.assets.digests[source.to_s.downcase]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment