Sort by ranking algorithm using will-paginate

Posted by bearwithclaws on Stack Overflow See other posts from Stack Overflow or by bearwithclaws
Published on 2010-02-14T11:23:13Z Indexed on 2010/05/28 15:21 UTC
Read the original article Hit count: 230

I'm creating a digg-like site using Ruby on Rails that ranks the item (based on this algorithm). I'm using the will-paginate gem list the items in pages.

The problem is, will-paginate only allows me to insert ':order =>' based on the table data. I would like to make will-paginate to sort by a number which is calculated using a function based on different fields on the table (e.g number of votes, age hours).

How can I do that?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about will-paginate