Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Can we access ActionView context within paginator.render? #239

Closed
damien-roche opened this Issue · 3 comments

3 participants

@damien-roche

I was trying to do something like this:

= paginator.render do
  %nav.pagination
    = link_to "example", example_path

Is there a way to access ActionView helpers from within render?

@damien-roche

Actually, a better method would be to use partials similar to what the generator creates:

= paginator.render do
  %nav.pagination
    perpage_tag
/# kaminari/_per_page
= link_to etc..

But I'm unsure as to how to use these tags? I tried to use 'render' but that didn't work inside paginator.render block.

Appreciate any insight.

@zzak
Collaborator

@damien-roche That is how the current parials work, can you explain more what you're trying to do?

@yuki24
Collaborator

@damien-roche Thank you for reporting! And you are right, you can't use helper methods in render block. This is not what we expect, and we should be able to use helper methods within the block.

@yuki24 yuki24 closed this in defc7ba
@yuki24 yuki24 referenced this issue from a commit in yuki24/kaminari
@yuki24 yuki24 Paginator should delegate view helper methods to template
fixes #239
d2ad221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.