1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

do not *always* create a new output_buffer but do it only when needed

This commit is contained in:
Akira Matsuda 2011-02-21 00:16:17 +09:00
parent 99b6627c21
commit 5b2c7f20b0
2 changed files with 5 additions and 1 deletions

View file

@ -17,6 +17,10 @@ module Kaminari
resolver.find_all(*args_for_lookup(name)).present?
end
def output_buffer #:nodoc:
@template.instance_variable_get('@output_buffer')
end
private
def context
@template.instance_variable_get('@lookup_context')

View file

@ -73,7 +73,7 @@ module Kaminari
def initialize(template, window_options) #:nodoc:
@template, @options = template, window_options.reverse_merge(template.options)
# so that this instance can actually "render". Black magic?
@output_buffer = ActionView::OutputBuffer.new
@output_buffer = @template.output_buffer || ActionView::OutputBuffer.new
end
# render given block as a view template