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 <[email protected]> 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 <[email protected]> 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 <[email protected]> > > > > 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 <[email protected]> wrote: > > > > are you sure you have installed the GEM ? > > > > > Thanks & Regards, > > > > Dhruva Sagar. > > > > > On Thu, Nov 26, 2009 at 8:54 AM, femto <[email protected]> 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 [email protected] > > > . > > > > > To unsubscribe from this group, send email to > > > > > [email protected]<rubyonrails-talk%2Bunsubscrib > > > > > [email protected]><rubyonrails-talk%2Bunsubscrib > > > [email protected]> > > > > > . > > > > > 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 [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<rubyonrails-talk%2Bunsubscrib > > > [email protected]> > > > . > > > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

