aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/abstract/renderer.rb8
-rw-r--r--actionpack/lib/action_controller/base/compatibility.rb4
-rw-r--r--actionpack/lib/action_controller/base/render_options.rb2
-rw-r--r--actionpack/lib/action_controller/caching/actions.rb3
4 files changed, 8 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/abstract/renderer.rb b/actionpack/lib/action_controller/abstract/renderer.rb
index f3e3903a3b..fe556281ab 100644
--- a/actionpack/lib/action_controller/abstract/renderer.rb
+++ b/actionpack/lib/action_controller/abstract/renderer.rb
@@ -31,8 +31,8 @@ module AbstractController
# partial<Boolean>:: Whether or not the template to render is a partial
#
# Override this method in a to change the default behavior.
- def _action_view
- @_action_view ||= ActionView::Base.for_controller(self)
+ def view_context
+ @_view_context ||= ActionView::Base.for_controller(self)
end
# Mostly abstracts the fact that calling render twice is a DoubleRenderError.
@@ -55,7 +55,7 @@ module AbstractController
def render_to_body(options = {})
# TODO: Refactor so we can just use the normal template logic for this
if options[:_partial_object]
- _action_view.render_partial(options)
+ view_context.render_partial(options)
else
_determine_template(options)
_render_template(options)
@@ -77,7 +77,7 @@ module AbstractController
# _layout<ActionView::Template>:: The layout to wrap the template in (optional)
# _partial<TrueClass, FalseClass>:: Whether or not the template to be rendered is a partial
def _render_template(options)
- _action_view.render_template(options[:_template], options[:_layout], options, options[:_partial])
+ view_context.render_template(options[:_template], options[:_layout], options, options[:_partial])
end
# The list of view paths for this controller. See ActionView::ViewPathSet for
diff --git a/actionpack/lib/action_controller/base/compatibility.rb b/actionpack/lib/action_controller/base/compatibility.rb
index 13813ffd17..23e7b1b3af 100644
--- a/actionpack/lib/action_controller/base/compatibility.rb
+++ b/actionpack/lib/action_controller/base/compatibility.rb
@@ -72,7 +72,7 @@ module ActionController
# TODO: Remove this after we flip
def template
- @template ||= _action_view
+ @template ||= view_context
end
def process_action(*)
@@ -141,7 +141,7 @@ module ActionController
end
def view_paths
- _action_view.view_paths
+ view_context.view_paths
end
end
end
diff --git a/actionpack/lib/action_controller/base/render_options.rb b/actionpack/lib/action_controller/base/render_options.rb
index fc9a02626f..65ee09883e 100644
--- a/actionpack/lib/action_controller/base/render_options.rb
+++ b/actionpack/lib/action_controller/base/render_options.rb
@@ -85,7 +85,7 @@ module ActionController
register_renderer :update
def _render_update(proc, options)
- generator = ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.new(_action_view, &proc)
+ generator = ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.new(view_context, &proc)
self.content_type = Mime::JS
self.response_body = generator.to_s
end
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb
index d8a1662acc..cb0c3a1384 100644
--- a/actionpack/lib/action_controller/caching/actions.rb
+++ b/actionpack/lib/action_controller/caching/actions.rb
@@ -129,8 +129,7 @@ module ActionController #:nodoc:
end
def content_for_layout(controller)
- # TODO: Remove this when new base is merged in
- template = controller.respond_to?(:template) ? controller.template : controller._action_view
+ template = controller.view_context
template.layout && template.instance_variable_get('@cached_content_for_layout')
end
end