Skip to content

Instantly share code, notes, and snippets.

@BenV
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenV/dc2b0f3a9f5c755cadb1 to your computer and use it in GitHub Desktop.
Save BenV/dc2b0f3a9f5c755cadb1 to your computer and use it in GitHub Desktop.
Disable Sprockets asset caching when cache_classes=true for development
# Sprockets configuration: prevent sprockets from caching assets in development
# when cache_classes is set to true
sprockets_env = nil
config.assets.configure do |env|
sprockets_env = env
# Sprockets environment configuration goes here
# env.js_compressor = :uglifier # or :closure, :yui
# env.css_compressor = :sass # or :yui
end
if config.cache_classes
config.after_initialize do
Rails.application.assets = sprockets_env
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment