Hello all,will_paginate don''t work on jruby platform, the Model.paginate find works ok, accepts all kinds of params, this is config.gem config.gem ''will_paginate'', :version => ''2.3.11'', :source => ''http://gemcutter.org'', but <%= will_paginate @collection %> doesn''t work it always produce nil(so nothing on page). weird. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
are you sure you have installed the GEM ? Thanks & Regards, Dhruva Sagar. On Thu, Nov 26, 2009 at 8:54 AM, femto <femtowin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello all,will_paginate don''t work on jruby platform, > the Model.paginate find works ok, accepts all kinds of params, > this is config.gem > config.gem ''will_paginate'', :version => ''2.3.11'', :source => > ''http://gemcutter.org'', > but <%= will_paginate @collection %> doesn''t work > it always produce nil(so nothing on page). weird. > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Yes, the paginate find method in controller works.(Model.paginate blah blah blah) but <%= will_paginate @collection %> doesn''t work on view. On 11月26日, 上午11时26分, Dhruva Sagar <dhruva.sa...@gmail.com> wrote:> are you sure you have installed the GEM ? > > Thanks & Regards, > Dhruva Sagar. > > > > On Thu, Nov 26, 2009 at 8:54 AM, femto <femto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello all,will_paginate don''t work on jruby platform, > > the Model.paginate find works ok, accepts all kinds of params, > > this is config.gem > > config.gem ''will_paginate'', :version => ''2.3.11'', :source => > > ''http://gemcutter.org'', > > but <%= will_paginate @collection %> doesn''t work > > it always produce nil(so nothing on page). weird. > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Well then are you sure that the query (conditions etc) that your running on the paginate method should infact return results ? Check the logs and see the query running in the background and see if that query does return some records in the @collection. Thanks & Regards, Dhruva Sagar. 2009/11/26 femto <femtowin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> Yes, the paginate find method in controller works.(Model.paginate blah > blah blah) > but <%= will_paginate @collection %> doesn''t work on view. > > > On 11月26日, 上午11时26分, Dhruva Sagar <dhruva.sa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > are you sure you have installed the GEM ? > > > > Thanks & Regards, > > Dhruva Sagar. > > > > > > > > On Thu, Nov 26, 2009 at 8:54 AM, femto <femto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello all,will_paginate don''t work on jruby platform, > > > the Model.paginate find works ok, accepts all kinds of params, > > > this is config.gem > > > config.gem ''will_paginate'', :version => ''2.3.11'', :source => > > > ''http://gemcutter.org'', > > > but <%= will_paginate @collection %> doesn''t work > > > it always produce nil(so nothing on page). weird. > > > > > -- > > > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm > . > > > To unsubscribe from this group, send email to > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org><rubyonrails-talk%2Bunsubscrib > e@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Alternatively I would also recommend you to try and do the same on the script/console and see if the paginate method is returning what you intend to return. Thanks & Regards, Dhruva Sagar. 2009/11/26 femto <femtowin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> Yes, the paginate find method in controller works.(Model.paginate blah > blah blah) > but <%= will_paginate @collection %> doesn''t work on view. > > > On 11月26日, 上午11时26分, Dhruva Sagar <dhruva.sa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > are you sure you have installed the GEM ? > > > > Thanks & Regards, > > Dhruva Sagar. > > > > > > > > On Thu, Nov 26, 2009 at 8:54 AM, femto <femto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello all,will_paginate don''t work on jruby platform, > > > the Model.paginate find works ok, accepts all kinds of params, > > > this is config.gem > > > config.gem ''will_paginate'', :version => ''2.3.11'', :source => > > > ''http://gemcutter.org'', > > > but <%= will_paginate @collection %> doesn''t work > > > it always produce nil(so nothing on page). weird. > > > > > -- > > > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm > . > > > To unsubscribe from this group, send email to > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org><rubyonrails-talk%2Bunsubscrib > e@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Hello Dhruva, I have done a test, when like say, @audits = Audit.paginate(:all, :page => params [:page], :per_page=>params[:per_page] ...) or(@audits = Audit.paginate(:page => params[:page], :per_page=>params [:per_page] ...)) ignore the first parameter, it all returns a will_pagination not correctly set @total_pages, @total_entries etc.(set @total_entries to 3, set @total_pages to 1, which is totally wrong where I have many audits) I''ve manual set its @total_pages, then <%= will_paginate @audits %> works, generate the pagination link, so I guess the problem lies somewhere in Audit.paginate doesn''t correctly set @total_pages, @total_entries. On 11月26日, 上午11时47分, Dhruva Sagar <dhruva.sa...@gmail.com> wrote:> Alternatively I would also recommend you to try and do the same on the > script/console and see if the paginate method is returning what you intend > to return. > > Thanks & Regards, > Dhruva Sagar. > > 2009/11/26 femto <femto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > Yes, the paginate find method in controller works.(Model.paginate blah > > blah blah) > > but <%= will_paginate @collection %> doesn''t work on view. > > > On 11月26日, 上午11时26分, Dhruva Sagar <dhruva.sa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > are you sure you have installed the GEM ? > > > > Thanks & Regards, > > > Dhruva Sagar. > > > > On Thu, Nov 26, 2009 at 8:54 AM, femto <femto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello all,will_paginate don''t work on jruby platform, > > > > the Model.paginate find works ok, accepts all kinds of params, > > > > this is config.gem > > > > config.gem ''will_paginate'', :version => ''2.3.11'', :source => > > > > ''http://gemcutter.org'', > > > > but <%= will_paginate @collection %> doesn''t work > > > > it always produce nil(so nothing on page). weird. > > > > > -- > > > > > 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com><rubyonrails-talk%2Bunsubscrib > > e@googlegroups.com> > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
audits'' count is 202, which is obviously so the .paginate set @total_entries to 3, set @total_pages to 1 is obviously wrong.weird.. , On 11月26日, 下午3时00分, femto <femto...@gmail.com> wrote:> Hello Dhruva, > I have done a test, > when like say, @audits = Audit.paginate(:all, :page => params > [:page], :per_page=>params[:per_page] ...) > or(@audits = Audit.paginate(:page => params[:page], :per_page=>params > [:per_page] ...)) ignore the first parameter, > it all returns a will_pagination not correctly set @total_pages, > @total_entries etc.(set @total_entries to 3, set @total_pages to 1, > which is totally wrong where I have many audits) > I''ve manual set its @total_pages, then > <%= will_paginate @audits %> works, generate the pagination link, > so I guess the problem lies somewhere in Audit.paginate doesn''t > correctly > set @total_pages, @total_entries. > > On 11月26日, 上午11时47分, Dhruva Sagar <dhruva.sa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Alternatively I would also recommend you to try and do the same on the > > script/console and see if the paginate method is returning what you intend > > to return. > > > Thanks & Regards, > > Dhruva Sagar. > > > 2009/11/26 femto <femto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > Yes, the paginate find method in controller works.(Model.paginate blah > > > blah blah) > > > but <%= will_paginate @collection %> doesn''t work on view. > > > > On 11月26日, 上午11时26分, Dhruva Sagar <dhruva.sa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > are you sure you have installed the GEM ? > > > > > Thanks & Regards, > > > > Dhruva Sagar. > > > > > On Thu, Nov 26, 2009 at 8:54 AM, femto <femto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello all,will_paginate don''t work on jruby platform, > > > > > the Model.paginate find works ok, accepts all kinds of params, > > > > > this is config.gem > > > > > config.gem ''will_paginate'', :version => ''2.3.11'', :source => > > > > > ''http://gemcutter.org'', > > > > > but <%= will_paginate @collection %> doesn''t work > > > > > it always produce nil(so nothing on page). weird. > > > > > > -- > > > > > > 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com><rubyonrails-talk%2Bunsubscrib > > > e@googlegroups.com> > > > > > . > > > > > For more options, visit this group at > > > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.