Permalink
Browse files

Include modules to the context in the railtie.

  • Loading branch information...
1 parent 914218e commit a19c260038a9b5b688a2e8d883b604983ac59eae @josevalim josevalim committed Apr 19, 2011
Showing with 7 additions and 6 deletions.
  1. +1 −6 actionpack/lib/action_view/helpers/sprockets_helper.rb
  2. +6 −0 actionpack/lib/sprockets/railtie.rb
@@ -66,9 +66,4 @@ def performing_caching?
end
end
end
-end
-
-# FIXME: Temp hack for extending Sprockets::Context so
-class Sprockets::Context
- include ActionView::Helpers::SprocketsHelper
-end if defined?(Sprockets)
+end
@@ -32,6 +32,12 @@ def self.using_scss?
next unless assets.enabled
app.assets = asset_environment(app)
+
+ # FIXME: Temp hack for extending Sprockets::Context so
+ ActiveSupport.on_load(:action_view) do
+ ::Sprockets::Context.send :include, ::ActionView::Helpers::SprocketsHelper
+ end
+
app.routes.append do
mount app.assets => assets.prefix
end

0 comments on commit a19c260

Please sign in to comment.