Skip to content

Instantly share code, notes, and snippets.

@daniel-rikowski
Created May 2, 2015 10:15
Show Gist options
  • Save daniel-rikowski/a96dd7b62accb158ce8a to your computer and use it in GitHub Desktop.
Save daniel-rikowski/a96dd7b62accb158ce8a to your computer and use it in GitHub Desktop.
Money patch for premailer-rails and Sprockets 3
Premailer::Rails::CSSLoaders::AssetPipelineLoader.class_eval do
def self.file_name(url)
URI(url).path
.sub("#{::Rails.configuration.assets.prefix}/", '')
.sub(/-\h{32,}\.css$/, '.css')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment