mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove private partial/template renderer methods
Since now these objects are not cached anymore, there's no need to have these private methods, just instantiate each of them in the necessary place.
This commit is contained in:
parent
a9aeba671d
commit
0134ca6a01
3 changed files with 3 additions and 14 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Partials
|
# = Action View Partials
|
||||||
#
|
#
|
||||||
|
|
|
@ -33,22 +33,12 @@ module ActionView
|
||||||
|
|
||||||
# Direct accessor to template rendering.
|
# Direct accessor to template rendering.
|
||||||
def render_template(context, options) #:nodoc:
|
def render_template(context, options) #:nodoc:
|
||||||
_template_renderer.render(context, options)
|
TemplateRenderer.new(@lookup_context).render(context, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Direct access to partial rendering.
|
# Direct access to partial rendering.
|
||||||
def render_partial(context, options, &block) #:nodoc:
|
def render_partial(context, options, &block) #:nodoc:
|
||||||
_partial_renderer.render(context, options, block)
|
PartialRenderer.new(@lookup_context).render(context, options, block)
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def _template_renderer #:nodoc:
|
|
||||||
TemplateRenderer.new(@lookup_context)
|
|
||||||
end
|
|
||||||
|
|
||||||
def _partial_renderer #:nodoc:
|
|
||||||
PartialRenderer.new(@lookup_context)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,7 +41,7 @@ module ActionView
|
||||||
|
|
||||||
# Renders the given template. A string representing the layout can be
|
# Renders the given template. A string representing the layout can be
|
||||||
# supplied as well.
|
# supplied as well.
|
||||||
def render_template(template, layout_name = nil, locals = {}) #:nodoc:
|
def render_template(template, layout_name = nil, locals = nil) #:nodoc:
|
||||||
view, locals = @view, locals || {}
|
view, locals = @view, locals || {}
|
||||||
|
|
||||||
render_with_layout(layout_name, locals) do |layout|
|
render_with_layout(layout_name, locals) do |layout|
|
||||||
|
|
Loading…
Reference in a new issue