aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/railtie.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/railtie.rb')
-rw-r--r--actionpack/lib/action_view/railtie.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/railtie.rb b/actionpack/lib/action_view/railtie.rb
index e8ea15f47c..33dfcbb803 100644
--- a/actionpack/lib/action_view/railtie.rb
+++ b/actionpack/lib/action_view/railtie.rb
@@ -5,9 +5,8 @@ module ActionView
# = Action View Railtie
class Railtie < Rails::Railtie
config.action_view = ActiveSupport::OrderedOptions.new
-
- require "action_view/railties/log_subscriber"
- log_subscriber :action_view, ActionView::Railties::LogSubscriber.new
+ config.action_view.stylesheet_expansions = {}
+ config.action_view.javascript_expansions = { :defaults => ['prototype', 'effects', 'dragdrop', 'controls', 'rails'] }
initializer "action_view.cache_asset_timestamps" do |app|
unless app.config.cache_classes
@@ -17,6 +16,18 @@ module ActionView
end
end
+ initializer "action_view.javascript_expansions" do |app|
+ ActiveSupport.on_load(:action_view) do
+ ActionView::Helpers::AssetTagHelper.register_javascript_expansion(
+ app.config.action_view.delete(:javascript_expansions)
+ )
+
+ ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion(
+ app.config.action_view.delete(:stylesheet_expansions)
+ )
+ end
+ end
+
initializer "action_view.set_configs" do |app|
ActiveSupport.on_load(:action_view) do
app.config.action_view.each do |k,v|