From f0945409d935cdd3cb783a728d68414e7ca02dfc Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 6 Aug 2009 19:43:28 -0300 Subject: [PATCH] replace _render_*_from_controller with render_* as they are intended to be public --- actionpack/examples/very_simple.rb | 2 +- actionpack/lib/action_controller/abstract/renderer.rb | 8 ++++---- actionpack/lib/action_view/context.rb | 4 ++-- actionpack/lib/action_view/render/partials.rb | 2 +- actionpack/lib/action_view/render/rendering.rb | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actionpack/examples/very_simple.rb b/actionpack/examples/very_simple.rb index 8d01cb39bd..e0f2d2bde8 100644 --- a/actionpack/examples/very_simple.rb +++ b/actionpack/examples/very_simple.rb @@ -23,7 +23,7 @@ class Kaigi < ActionController::Http DEFAULT_LAYOUT = Object.new.tap {|l| def l.render(*) yield end } - def _render_template_from_controller(template, layout = DEFAULT_LAYOUT, options = {}, partial = false) + def render_template(template, layout = DEFAULT_LAYOUT, options = {}, partial = false) ret = template.render(self, {}) layout.render(self, {}) { ret } end diff --git a/actionpack/lib/action_controller/abstract/renderer.rb b/actionpack/lib/action_controller/abstract/renderer.rb index 41b7d47458..f3e3903a3b 100644 --- a/actionpack/lib/action_controller/abstract/renderer.rb +++ b/actionpack/lib/action_controller/abstract/renderer.rb @@ -19,11 +19,11 @@ module AbstractController # The view class must have the following methods: # View.for_controller[controller] Create a new ActionView instance for a # controller - # View#_render_partial_from_controller[options] + # View#render_partial[options] # - responsible for setting options[:_template] # - Returns String with the rendered partial # options:: see _render_partial in ActionView::Base - # View#_render_template_from_controller[template, layout, options, partial] + # View#render_template[template, layout, options, partial] # - Returns String with the rendered template # template:: The template to render # layout:: The layout to render around the template @@ -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_from_controller(options) + _action_view.render_partial(options) else _determine_template(options) _render_template(options) @@ -77,7 +77,7 @@ module AbstractController # _layout:: The layout to wrap the template in (optional) # _partial:: Whether or not the template to be rendered is a partial def _render_template(options) - _action_view._render_template_from_controller(options[:_template], options[:_layout], options, options[:_partial]) + _action_view.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_view/context.rb b/actionpack/lib/action_view/context.rb index f212fe25eb..df078a7151 100644 --- a/actionpack/lib/action_view/context.rb +++ b/actionpack/lib/action_view/context.rb @@ -12,11 +12,11 @@ module ActionView # # Context.for_controller[controller] Create a new ActionView instance for a # controller - # Context#_render_partial_from_controller[options] + # Context#render_partial[options] # - responsible for setting options[:_template] # - Returns String with the rendered partial # options:: see _render_partial in ActionView::Base - # Context#_render_template_from_controller[template, layout, options, partial] + # Context#render_template[template, layout, options, partial] # - Returns String with the rendered template # template:: The template to render # layout:: The layout to render around the template diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb index ccb14d513a..8bdff0f3b9 100644 --- a/actionpack/lib/action_view/render/partials.rb +++ b/actionpack/lib/action_view/render/partials.rb @@ -177,7 +177,7 @@ module ActionView attr_accessor :_partial end - def _render_partial_from_controller(*args) + def render_partial(*args) @assigns_added = false _render_partial(*args) end diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb index 162e38c484..86a59dd1bc 100644 --- a/actionpack/lib/action_view/render/rendering.rb +++ b/actionpack/lib/action_view/render/rendering.rb @@ -123,7 +123,7 @@ module ActionView layout ? _render_content_with_layout(text, layout, options[:locals]) : text end - def _render_template_from_controller(*args) + def render_template(*args) @assigns_added = nil _render_template_with_layout(*args) end