Ajaxful-Rating for Ruby on Rails Rating or Voting

For a recent client project Squish 360 iPhone Challenge we had used a plugin called Vote Fu for rating video’s up or down.  It worked out pretty nicely, but only handles the concept of a binary vote.. Yes or No.. Good or Bad.. Like or Dislike..  On a new project we needed something that represented rating in terms of a range.  1 through 5 stars.  We can certainly argue about which approach is better, but ultimately it was a reasonable request by the product owner, so we went in search of a solution.

We stumbled upon Ajaxful-Rating.  It seemed to do what we wanted and was one of the more current voting solutions for Rails out there.  It was pretty straight forward to implement.  The only thing that was unclear in the documentation was whether you had to specify a dimension or if leaving it blank would be acceptable.  Turns out leaving it blank works just fine.

Things we ran into.  In it’s view helper there was ratings_for but not the concept of user_ratings_for.  We needed to see a static version of how the user had rated things so we made a helper to do this.  We will clean it up some and submit a patch to the project.  Additionally, we had to change the background image a little bit.  This was easy to do, but since it was a different size it caused some problems.  The calculated value in the helper has a hard coded value, in order to change it requires changing the plug-in.   We plan to re-factor this so that it is a passed parameter with a default so that it can be changed without touching the plug-in.  We will also submit that as a patch.

If you know of a better voting/rating plug-in we would love to hear about it, but for now Ajaxful-Rating seems usable.

2 thoughts on “Ajaxful-Rating for Ruby on Rails Rating or Voting

Step up to the mic.

Your email address will not be published.