apotonick / kaminari-cells

Kaminari pagination in Cells.
MIT License
23 stars 15 forks source link

#paginate generates nothing when using the kaminari default views #2

Open bingxie opened 8 years ago

bingxie commented 8 years ago

I found in the default kaminari view(_paginator.html.slim), the method paginator.render return nothing. I am not sure what is the right way to generate the view.

cells: 4.0.3 kaminari: 0.16.3

bingxie commented 8 years ago

The reason is related to @output_buffer variable form ::ActionView::Context doesn't get set. But I don't knew how to fix it.

bingxie commented 8 years ago

Finally, I got a fix. don't use paginator.render, directly use paginator.***_tag methods.

zlobz commented 8 years ago

Kaminari monkey patch

Kaminari::Helpers::Paginator.class_eval do
  def render(&block)
    instance_eval(&block) if @options[:total_pages] > 1
  end
end
bingxie commented 8 years ago

Thanks @xzo

johnlane commented 8 years ago

Maybe this StackOverflow question is a similar related problem?

ValentinTrinque commented 8 years ago

I experienced the same problem on kaminari (0.17.0), kaminari-cells (0.0.4) and cells (4.1.3)

This seems to be the cause http://stackoverflow.com/a/37537318/4273180