Fix @renderer warning
This commit is contained in:
parent
2fbd6f46fd
commit
97be8537eb
@ -181,20 +181,20 @@ class PartialRenderer
|
||||
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 @@ def collection_with_template(template)
|
||||
|
||||
segments << template.render(@view, locals)
|
||||
end
|
||||
|
||||
|
||||
@template = template
|
||||
segments
|
||||
end
|
||||
@ -294,7 +294,7 @@ def find_template(path = @path)
|
||||
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 @@ def render_partial(options)
|
||||
_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 @@ def render_partial(options)
|
||||
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 New Issue
Block a user