Hi, I am trying to use the will_paginate helper. I installed the gem and put "require ''will_paginate''" in the environment.rb file. In my controller @tasks = Task.paginate :page => params[:page], :order => ''date_begin DESC'' In my view <%= will_paginate @tasks %> The view doesn''t show anything. Did I miss something ? (the @tasks variable is not empty) -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Sep 22, 7:24 pm, MR Damien <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > I am trying to use the will_paginate helper. > > I installed the gem and put "require ''will_paginate''" in the > environment.rb file. > > In my controller > > @tasks = Task.paginate :page => params[:page], :order => ''date_begin > DESC'' > > In my view > > <%= will_paginate @tasks %> > > The view doesn''t show anything. Did I miss something ? (the @tasks > variable is not empty)How many records does @tasks contain? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think you''re missing the :per_page option @tasks = Task.paginate :page => params[:page], :per_page => 50, :order => ''date_begin DESC'' should work. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thorsten Mueller wrote:> I think you''re missing the :per_page option > > @tasks = Task.paginate :page => params[:page], :per_page => > 50, :order => ''date_begin > DESC'' > > should work.You win :) I though this argument was facultative. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mon, Sep 22, 2008 at 1:41 PM, MR Damien <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I though this argument was facultative. >If you don''t specify anything, it will display 30 :per_page Franz --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Franz Strebel wrote:> On Mon, Sep 22, 2008 at 1:41 PM, MR Damien > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org >> wrote: > >> >> I though this argument was facultative. >> > > If you don''t specify anything, it will display 30 :per_page > > FranzThanks Franz, you know I originally had that but it did not work either. Turns out my loop in the view was wrong. Should have been ''@blog_entries.each do'' I had ''@entries.each do''. Oh well its fixed now :@) Cheers Steve -- Posted via http://www.ruby-forum.com/.