lib/kaminari/helpers/paginator.rb in kaminari-0.12.3 vs lib/kaminari/helpers/paginator.rb in kaminari-0.12.4
- old
+ new
@@ -1,11 +1,15 @@
require File.join(File.dirname(__FILE__), 'tags')
+require 'action_view/context'
module Kaminari
module Helpers
# The main container tag
class Paginator < Tag
+ # so that this instance can actually "render"
+ include ::ActionView::Context
+
def initialize(template, options) #:nodoc:
@window_options = {}.tap do |h|
h[:window] = options.delete(:window) || options.delete(:inner_window) || Kaminari.config.window
outer_window = options.delete(:outer_window) || Kaminari.config.outer_window
h[:left] = options.delete(:left) || Kaminari.config.left
@@ -14,10 +18,10 @@
h[:right] = outer_window if h[:right] == 0
end
@template, @options = template, options
@theme = @options[:theme] ? "#{@options[:theme]}/" : ''
@options[:current_page] = PageProxy.new @window_options.merge(@options), @options[:current_page], nil
- # so that this instance can actually "render". Black magic?
+ # initialize the output_buffer for Context
@output_buffer = ActionView::OutputBuffer.new
end
# render given block as a view template
def render(&block)