RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: factor4
try the reputation-system-from-scratch. I got this to work with will_paginate.
I had a problem with your reputation-system-from-scratch, that all haikus with more than one vote were ordered as they had only one vote. I added the SUM() function to the by_votes class method to solve this. I also had to add group to the query to get more than one haiku. Without SUM() and group I got duplicate haikus.
select('haikus.*, coalesce(SUM(value), 0) as votes').
joins('left join haiku_votes on haiku_id=haikus.id').