# Will\_paginate problem

**URL:** <https://www.ruby-forum.com/t/will-paginate-problem/167207>\
**Category:** Rails\
**Created:** [May 5, 2009, 3:00pm UTC](https://www.ruby-forum.com/t/will-paginate-problem/167207 "2009-05-05T15:00:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![furrot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/3da27b/32.png) [@furrot](https://www.ruby-forum.com/u/furrot)\
**Post date:** [May 5, 2009, 3:00pm UTC](https://www.ruby-forum.com/t/will-paginate-problem/167207/1 "2009-05-05T15:00:35Z")

</div>

Hi all,

I’m having a bit of a problem with displaying a blog list using the  
will\_paginate helper. My code is:

entries\_controller:

def index  
@entries = Entry.find(:all)  
@blog\_entries = @entries.paginate( :page =\> params[:page], :per\_page =\>  
4,  
:include =\> :user,  
:order =\> ‘topics.updated\_at  
DESC’)  
end

Basically I am trying to display a blog index which is the contents of  
the Entry table. In my index view I have:

\<%= will\_paginate @blog\_entries %\>

But nothing happens when I add more than 4 blog entries. Where am I  
going wrong?

Thanks

Stephen

---

<div class="post-metadata">

**Author:** ![furrot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/3da27b/32.png) [@furrot](https://www.ruby-forum.com/u/furrot)\
**Post date:** [May 5, 2009, 3:04pm UTC](https://www.ruby-forum.com/t/will-paginate-problem/167207/2 "2009-05-05T15:04:56Z")

</div>

I guess this is what you’re trying to do:

def index  
@blog\_entries = Entry.paginate( :page =\> params[:page], :per\_page  
=\> 4, :include =\> :user, :order =\> 'topics.updated\_at )  
end

- 

Maurício Linhares  
[http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) | [http://blog.codevader.com/](http://blog.codevader.com/)  
(en)

On Tue, May 5, 2009 at 10:00 AM, Stephen F.
