aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-04-19 21:49:28 +0200
committerJosé Valim <jose.valim@gmail.com>2011-04-19 21:49:28 +0200
commita19c260038a9b5b688a2e8d883b604983ac59eae (patch)
tree3ca78cb75af13937c00abd7393e1e73ecc968018 /actionpack
parent914218ef302542f3f58ef7f8f46c0ff0b540ac82 (diff)
downloadrails-a19c260038a9b5b688a2e8d883b604983ac59eae.tar.gz
rails-a19c260038a9b5b688a2e8d883b604983ac59eae.tar.bz2
rails-a19c260038a9b5b688a2e8d883b604983ac59eae.zip
Include modules to the context in the railtie.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/sprockets_helper.rb7
-rw-r--r--actionpack/lib/sprockets/railtie.rb6
2 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/sprockets_helper.rb b/actionpack/lib/action_view/helpers/sprockets_helper.rb
index e2e844c74d..947c827f3c 100644
--- a/actionpack/lib/action_view/helpers/sprockets_helper.rb
+++ b/actionpack/lib/action_view/helpers/sprockets_helper.rb
@@ -66,9 +66,4 @@ module ActionView
end
end
end
-end
-
-# FIXME: Temp hack for extending Sprockets::Context so
-class Sprockets::Context
- include ActionView::Helpers::SprocketsHelper
-end if defined?(Sprockets) \ No newline at end of file
+end \ No newline at end of file
diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb
index fe3c8c9783..2f7f95c44d 100644
--- a/actionpack/lib/sprockets/railtie.rb
+++ b/actionpack/lib/sprockets/railtie.rb
@@ -32,6 +32,12 @@ module Sprockets
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