mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix @renderer warning
This commit is contained in:
parent
2fbd6f46fd
commit
97be8537eb
1 changed files with 10 additions and 10 deletions
|
@ -181,20 +181,20 @@ module ActionView
|
|||
def initialize(view_context, options, block)
|
||||
@view = view_context
|
||||
@partial_names = PARTIAL_NAMES[@view.controller.class]
|
||||
|
||||
|
||||
key = Thread.current[:format_locale_key]
|
||||
@templates = TEMPLATES[key] if key
|
||||
|
||||
|
||||
setup(options, block)
|
||||
end
|
||||
|
||||
|
||||
def setup(options, block)
|
||||
partial = options[:partial]
|
||||
|
||||
|
||||
@options = options
|
||||
@locals = options[:locals] || {}
|
||||
@block = block
|
||||
|
||||
|
||||
if String === partial
|
||||
@object = options[:object]
|
||||
@path = partial
|
||||
|
@ -240,7 +240,7 @@ module ActionView
|
|||
|
||||
segments << template.render(@view, locals)
|
||||
end
|
||||
|
||||
|
||||
@template = template
|
||||
segments
|
||||
end
|
||||
|
@ -294,7 +294,7 @@ module ActionView
|
|||
path && @templates[path] ||= _find_template(path)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def _find_template(path)
|
||||
if controller = @view.controller
|
||||
prefix = controller.controller_path unless path.include?(?/)
|
||||
|
@ -319,7 +319,7 @@ module ActionView
|
|||
_evaluate_assigns_and_ivars
|
||||
|
||||
details = options[:_details]
|
||||
|
||||
|
||||
# Is this needed
|
||||
self.formats = details[:formats] if details
|
||||
renderer = PartialRenderer.new(self, options, nil)
|
||||
|
@ -329,12 +329,12 @@ module ActionView
|
|||
end
|
||||
|
||||
def _render_partial(options, &block) #:nodoc:
|
||||
if @renderer
|
||||
if defined? @renderer
|
||||
@renderer.setup(options, block)
|
||||
else
|
||||
@renderer = PartialRenderer.new(self, options, block)
|
||||
end
|
||||
|
||||
|
||||
@renderer.render
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue