Paginator offset =0

Hi list,

I Try to do a custom paginator, but the offset never increase ??

def
showFriends

  @friends_pages = Paginator.new self, allFriends.size, 3,

@params[‘page’]
limit= @friends_pages.items_per_page
offset= @friends_pages.current.offset
logger.info(“limit=#{limit}, offset=#{offset}”)
<==== ALWAYS 0 since params[‘page’] =2 for
@friends_list=allFriends.slice(offset,offset+limit)
end

I thought that the paginator object compute the offset using the size of
the list, the limit and the page number ? I certainly miss somenthing
:wink:

thanks
arnaud

forget it, it works … :wink:

Arnaud G. a écrit :

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