Kaminari: how page=1-param in link to first page?

Kaminari omits the :page-param for the first page. Does anybody know a
way to get this ‘fixed’?

I’m now doing it this way (in _first_page_link.erb):

<%= link_to page, url + ‘?page=1’, :remote => remote %>

but this is not really satisfying.

Thanks, T.

I’ve ended up with monkeypatching:

https://gist.github.com/889160

module Kaminari
module Helpers
class Tag
def page_url_for(page)
@template.url_for @template.params.merge(@param_name => (page
< 1 ? nil : page))
end
end
end
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs