From: Jack Royal-Gordon <jac...@pobox.com>
Date: Sun, 12 Feb 2012 08:59:29 -0800
Local: Sun, Feb 12 2012 11:59 am
Subject: Re: Show 3 records, only advance 1
The key lies in how paginate pages the data. For an ActiveRecord source, it generates the following ARel modifiers:
offset how many records to skip before starting collection limit how many records to include in the collection will_paginate's default processing is to use offset => (pager.offset) and limit => (pager.per_page), but what you want is offset => (pager.page - 1), limit => (pager.per_page). This can be accomplished by performing manual paging, as documented with WillPaginate::Collection: # Just like +new+, but yields the object after instantiation and returns it There may be an easier way to accomplish this -- let's see what others say. On Feb 10, 2012, at 7:36 PM, Rembrant wrote: > Hello,
> I want to show (3) records per page but when the next or previous > e.g. > | 1 2 3 | 4 5 > becomes > 1 | 2 3 4 | 5 > Any help would be greatly appreciated. > Many thanks, > Rembrant > -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||