Jan'uary » 日志 » gotcha in rails paginating_find plugin
gotcha in rails paginating_find plugin
Jan 发表于 2008-03-20 13:24:34
When you installed this plugin, you can:
ps = Product.find :all, :page => {:size => 10, :current => 2}
Then the result of 2nd page will be returned. However, the ps.size won't return the true size of the result set of 2nd page, it will return the 'Total size' of products! You can't get the real size unless you write your own 'size'.
Really bad, use will_paginate instead. (I use this only for compatible reason)
ps = Product.find :all, :page => {:size => 10, :current => 2}
Then the result of 2nd page will be returned. However, the ps.size won't return the true size of the result set of 2nd page, it will return the 'Total size' of products! You can't get the real size unless you write your own 'size'.
Really bad, use will_paginate instead. (I use this only for compatible reason)
曾经的这一天...
- » 2006年: zz外国人眼中的三国
- » 2006年: 非常棒的调酒网站
相关日志:
收藏:
QQ书签
del.icio.us
订阅:
Google
抓虾
