aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller/rendering.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/abstract_controller/rendering.rb')
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb18
1 files changed, 3 insertions, 15 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index a5f983a55b..f78365afdb 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -46,20 +46,9 @@ module AbstractController
module ClassMethods
def view_context_class
@view_context_class ||= begin
- controller = self
- Class.new(ActionView::Base) do
- if controller.respond_to?(:_routes) && controller._routes
- include controller._routes.url_helpers
- include controller._routes.mounted_helpers
- end
-
- if controller.respond_to?(:_helpers)
- include controller._helpers
-
- # TODO: Fix RJS to not require this
- self.helpers = controller._helpers
- end
- end
+ routes = _routes if respond_to?(:_routes)
+ helpers = _helpers if respond_to?(:_helpers)
+ ActionView::Base.prepare(routes, helpers)
end
end
end
@@ -121,7 +110,6 @@ module AbstractController
view_renderer.render(view_context, options)
end
-
private
# This method should return a hash with assigns.