Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bingxie opened this issue Dec 22, 2015 · 6 comments
Open

Comments

@bingxie
Copy link
Contributor

bingxie commented Dec 22, 2015

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
Copy link
Contributor Author

bingxie commented Dec 22, 2015

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
Copy link
Contributor Author

bingxie commented Dec 22, 2015

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

@zlobz
Copy link

zlobz commented Jan 11, 2016

Kaminari monkey patch

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

@bingxie
Copy link
Contributor Author

bingxie commented Jan 12, 2016

Thanks @xzo

@johnlane
Copy link

Maybe this StackOverflow question is a similar related problem?

@ValentinTrinque
Copy link

ValentinTrinque commented Oct 1, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants