Hook up AV::Rendering on AV intialization

This commit is contained in:
Łukasz Strzałkowski 2013-06-26 15:54:29 +02:00
parent c48ce6e73d
commit 766fa97b45
3 changed files with 7 additions and 3 deletions

View File

@ -163,6 +163,8 @@ module AbstractController
method_for_action(action_name).present?
end
ActiveSupport.run_load_hooks(:abstract_controller, self)
private
# Returns true if the name can be considered an action because

View File

@ -2,8 +2,6 @@ module ActionController
module Rendering
extend ActiveSupport::Concern
include ActionView::Rendering
# Before processing, set the request formats in current controller formats.
def process_action(*) #:nodoc:
self.formats = request.formats.map(&:ref).compact

View File

@ -36,10 +36,14 @@ module ActionView
end
end
initializer "action_view.setup_action_controller" do |app|
initializer "action_view.setup_action_pack" do |app|
ActiveSupport.on_load(:action_controller) do
ActionController::Base.send(:include, ActionView::Layouts)
end
ActiveSupport.on_load(:abstract_controller) do
AbstractController::Base.send(:include, ActionView::Rendering)
end
end
end
end