On Jul 29, 2010, at 10:51 PM, Karel Minařík wrote:

> Hi Chris,
> 
> thanks for the feedback. I am well aware of the shortcoming. Two reasons, 
> mainly:
> 
> a) I had the code ready from previous implementation for the RelaxDB gem.
> 
> b) I had not enough time to figure out/translate the abstract description 
> from the recipe into code. Moreover, will_paginate depends on the "Jump to 
> Page" functionality 
> [http://mislav.uniqpath.com/page_attachments/0000/0045/will_paginate-digg-style.png].
>  As far as I understand it, that's explicitely explained as impossible with 
> the "correct" solution as presented in recipe?
> 

Jump to page is impractical at scale. You see that Gmail and Google search 
don't offer explicit jump-t0-page. 

You can however, jump by natural key (so you can jump to May 5th, or whatever) 
which I think is more useful than jump to page 14.

Chris

> Karel
> 
> On 29.Jul, 2010, at 19:04 , Chris Anderson wrote:
> 
>> Why not use the linked list style  pagination described also in that recipe? 
>> The problem with the skip approach is that the 1000th page will take a long 
>> time to load (and potentially disrupt database performance for other 
>> queries). I'm not sure what advantage the approach you take gives over the 
>> proper solution.
>> 
>> Sent from my iPhone
>> 
>> On Jul 29, 2010, at 7:01 AM, Karel Minařík <[email protected]> wrote:
>> 
>>> Hi,
>>> 
>>> I've recently needed will_paginate 
>>> [http://github.com/mislav/will_paginate/] pagination for CouchPotato 
>>> [http://github.com/langalex/couch_potato] views.
>>> 
>>> You can get the WillPaginate adapter from the following Gist:
>>> 
>>> --> http://gist.github.com/498177
>>> 
>>> Tests are included in-file. Note that it uses the non-recommended, "slow" 
>>> method of pagination as described in the relax book 
>>> (http://books.couchdb.org/relax/reference/recipes#Pagination). Feedback is 
>>> appreciated.
>>> 
>>> Karel
>>> 
>>> --
>>> www.karmi.cz
> 

Reply via email to