Skip to content

Commit

Permalink
Remove private partial/template renderer methods
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
carlosantoniodasilva committed Nov 22, 2012
1 parent a9aeba6 commit 0134ca6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion actionpack/lib/action_view/renderer/partial_renderer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

module ActionView
# = Action View Partials
#
Expand Down
14 changes: 2 additions & 12 deletions actionpack/lib/action_view/renderer/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,12 @@ def render_body(context, options)

# Direct accessor to template rendering.
def render_template(context, options) #:nodoc:
_template_renderer.render(context, options)
TemplateRenderer.new(@lookup_context).render(context, options)
end

# Direct access to partial rendering.
def render_partial(context, options, &block) #:nodoc:
_partial_renderer.render(context, options, block)
end

private

def _template_renderer #:nodoc:
TemplateRenderer.new(@lookup_context)
end

def _partial_renderer #:nodoc:
PartialRenderer.new(@lookup_context)
PartialRenderer.new(@lookup_context).render(context, options, block)
end
end
end
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/renderer/template_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def determine_template(options) #:nodoc:

# Renders the given template. A string representing the layout can be
# 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 || {}

render_with_layout(layout_name, locals) do |layout|
Expand Down

0 comments on commit 0134ca6

Please sign in to comment.