Skip to content

Instantly share code, notes, and snippets.

@skanev
Created September 15, 2011 17:03
Show Gist options
  • Select an option

  • Save skanev/1219818 to your computer and use it in GitHub Desktop.

Select an option

Save skanev/1219818 to your computer and use it in GitHub Desktop.
Replacing Sprocketizer with Sprockets 2.0
Something::Application.routes.draw do
# ...
mount SprocketizerReplacement.app => 'sprockets'
end
module SprocketizerReplacement
extend self
def app
Sprockets::Environment.new(Rails.root.to_s) do |env|
env.logger = Rails.logger
env.version = Rails.env + '-1.0'
env.cache = Rails.cache
env.append_path 'app/javascripts'
end
end
end
@Mange
Copy link
Copy Markdown

Mange commented Sep 21, 2011

Shouldn't you always assign Rails.cache? In development, Rails.cache is a simple in-memory cache that is cleared between all requests AFAIK.

@skanev
Copy link
Copy Markdown
Author

skanev commented Sep 21, 2011

Good point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment