diff options
Diffstat (limited to 'actionpack/lib/action_view/railtie.rb')
-rw-r--r-- | actionpack/lib/action_view/railtie.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/railtie.rb b/actionpack/lib/action_view/railtie.rb index e8ea15f47c..d453f30882 100644 --- a/actionpack/lib/action_view/railtie.rb +++ b/actionpack/lib/action_view/railtie.rb @@ -6,6 +6,9 @@ module ActionView class Railtie < Rails::Railtie config.action_view = ActiveSupport::OrderedOptions.new + # setup default js includes + config.action_view.javascript_expansions = { :defaults => ['prototype', 'effects', 'dragdrop', 'controls', 'rails'] } + require "action_view/railties/log_subscriber" log_subscriber :action_view, ActionView::Railties::LogSubscriber.new @@ -17,6 +20,12 @@ 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.javascript_expansions) + end + end + initializer "action_view.set_configs" do |app| ActiveSupport.on_load(:action_view) do app.config.action_view.each do |k,v| |