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/ (pt-br) | http://blog.codevader.com/ (en) On Tue, May 5, 2009 at 10:00 AM, Stephen Fagan <rails-mailing-l...@andreas-s.net> wrote: > > 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 > -- > Posted via http://www.ruby-forum.com/. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---