# Will\_paginate working in the opposite way expected

**URL:** <https://www.ruby-forum.com/t/will-paginate-working-in-the-opposite-way-expected/156443>\
**Category:** Rails\
**Created:** [December 27, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/will-paginate-working-in-the-opposite-way-expected/156443 "2008-12-27T19:38:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 27, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/will-paginate-working-in-the-opposite-way-expected/156443/1 "2008-12-27T19:38:41Z")

</div>

Hi,

I am creating a little blogging engine, so I want the most recent posts  
to display first, so I make a search with :order =\> ‘created\_at DESC’

For some reason, will\_paginate works the opposite way I expect it to be.  
I mean the previous / next links are opposite to what I want. What could  
I be doing wrong?

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 28, 2008, 12:25am UTC](https://www.ruby-forum.com/t/will-paginate-working-in-the-opposite-way-expected/156443/2 "2008-12-28T00:25:42Z")

</div>

On 27 Dec 2008, at 18:38, Fernando P. wrote:

> could  
> I be doing wrong?

As in Next fetches older posts ? If so you’re not doing anything  
wrong. While you may thing of next as more recents posts,  
will\_paginate only cares about it being the next page.  
You can tell will\_paginate what labels to use for the links with  
the :next\_label/:previous\_label options so you can swap them around or  
use something less ambiguous like older/newer

Fred

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 29, 2008, 6:36pm UTC](https://www.ruby-forum.com/t/will-paginate-working-in-the-opposite-way-expected/156443/3 "2008-12-29T18:36:34Z")

</div>

Frederick C. wrote:

> On 27 Dec 2008, at 18:38, Fernando P. wrote:
> 
> > could  
> > I be doing wrong?
> 
> As in Next fetches older posts ? If so you’re not doing anything  
> wrong. While you may thing of next as more recents posts,  
> will\_paginate only cares about it being the next page.  
> You can tell will\_paginate what labels to use for the links with  
> the :next\_label/:previous\_label options so you can swap them around or  
> use something less ambiguous like older/newer
> 
> Fred

Ok I get it Frederick, so everything is working fine, it’s just the name  
that mixed me up. Thanks.
