Hack-job of a class to force Sprockets to rebuild assets every request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hack-job of a class to force Sprockets to rebuild assets every request | |
class NoCacheSprockets < Sprockets::Environment | |
# Bypass Sprockets::Environment's caching, and call Sprockets::Base's method directly | |
def find_asset(path, options = {}) | |
self.class.superclass.superclass.instance_method(:find_asset).bind(self).call(path, options) | |
end | |
# Prevent any 304 responses (for the web browser's sake) | |
def not_modified?(asset,env) | |
false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment