You are invited to my open alpha of MyQuotable.com More MyQuotable features
Jul 23

The lastest version of VoteFu has a few useful enhancements:

  1. Protect against mass assignment forgery. The params hash will only be consulted for :vote => true or false. The rest has to be assigned in the controller.
  2. The acts_as_voteable mixin now has support for tallying votes.

The documentation will be updated tonight, but briefly, here is what you can do with the new tally() method:

1
2
3
4
5
6
7
8
@items = Item.tally(
  {  :at_least => 1, 
      :at_most => 10000,  
      :start_at => 2.weeks.ago,
      :end_at => 1.day.ago,
      :limit => 10,
      :order => "items.name desc"
  })

This will select the Items with between 1 and 10,000 votes, the votes having been cast within the last two weeks (not including today), then display the 10 last items in an alphabetical list.

More to come. Enjoy!

discussion by DISQUS

Add New Comment

blog comments powered by Disqus