# Help....Paginating\_find

**URL:** <https://www.ruby-forum.com/t/help-paginating-find/158433>\
**Category:** Rails\
**Created:** [January 23, 2009, 8:43am UTC](https://www.ruby-forum.com/t/help-paginating-find/158433 "2009-01-23T08:43:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [January 23, 2009, 8:43am UTC](https://www.ruby-forum.com/t/help-paginating-find/158433/1 "2009-01-23T08:43:29Z")

</div>

Hi everyone,  
I’m using the paginating\_find plugin to give pagination to my views…  
It works great…but  
Even if there is a single page in the list…it gives me a pagination  
link…which I don’t want…!!!  
I need some help to know- how to check whether there is a only one page  
in the result…so that I don’t print the links…  
Thank You…

---

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [January 23, 2009, 4:58pm UTC](https://www.ruby-forum.com/t/help-paginating-find/158433/2 "2009-01-23T16:58:15Z")

</div>

Use ruby script/console in a command prompt to try things out…

> > c = Company.find(:all, :page =\> {:current =\> 1, :size =\> 1}, :limit =\> 1)  
> > =\> #\<PagingEnumerator:0x5d29880 @page\_count=1, @first\_page=1, @size=1,  
> > @page=1, @page\_size  
> > =1, @callback=#Proc:0x0618463c@C:/../lib/paginating\_find.rb:82,  
> > @last\_page=1, @stop\_page=1, @auto=false\>

> > c.page\_count  
> > =\> 1

In your view check that @your\_collection.page\_count \> 1 before you call  
the paginating find partial that generates the pages.

---

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [January 27, 2009, 6:53am UTC](https://www.ruby-forum.com/t/help-paginating-find/158433/3 "2009-01-27T06:53:26Z")

</div>

Hey Luke…  
Thank you so much for your help…  
That solution worked like a charm…  
Thanks again…

Luke P. wrote:

> Use ruby script/console in a command prompt to try things out…
> 
> > > c = Company.find(:all, :page =\> {:current =\> 1, :size =\> 1}, :limit =\> 1)  
> > > =\> #\<PagingEnumerator:0x5d29880 @page\_count=1, @first\_page=1, @size=1,  
> > > @page=1, @page\_size  
> > > =1, @callback=#Proc:0x0618463c@C:/../lib/paginating\_find.rb:82,  
> > > @last\_page=1, @stop\_page=1, @auto=false\>
> 
> > > c.page\_count  
> > > =\> 1
> 
> In your view check that @your\_collection.page\_count \> 1 before you call  
> the paginating find partial that generates the pages.
