diff --git a/lib/kaminari/helpers/helpers.rb b/lib/kaminari/helpers/helpers.rb index c6eea6d..daac5de 100644 --- a/lib/kaminari/helpers/helpers.rb +++ b/lib/kaminari/helpers/helpers.rb @@ -17,10 +17,6 @@ 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') diff --git a/lib/kaminari/helpers/tags.rb b/lib/kaminari/helpers/tags.rb index 0cb564f..5d77d63 100644 --- a/lib/kaminari/helpers/tags.rb +++ b/lib/kaminari/helpers/tags.rb @@ -74,17 +74,13 @@ 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 = @template.output_buffer - if @output_buffer.nil? - @output_buffer, @return_buffer = ActionView::OutputBuffer.new, true - end + @output_buffer = ActionView::OutputBuffer.new end # render given block as a view template def render(&block) instance_eval &block if @options[:num_pages] > 1 - # return the output text only if the output_buffer was created inside this instance - @return_buffer ? @output_buffer : nil + @output_buffer end # enumerate each page providing PageProxy object as the block parameter