Rails Star Ratings Plugin Comparison
There are a kajillion Rails rating plugins.
Diversity is good, but choice is time-consuming. Here’s a quick rundown of the options.
This post reviews the existing options from the perspective of a rails developer who wants a star rating system that handles views and jquery ajax without costing very much time to setup. This means that if the README wasn’t clear, I often wrote off the plugin.
To review each plugin, I setup a rails app with a User model and a Frog model. Users can, of course, rate frogs. You can find the git repo here. The ones that I went through on trying are in branches.
Here are the plugins/gems that I tried:
Ajaxful rating
- Github followers: 136
- Actively being updated: Yes
- README usefulness: high
- Lines of code I had to add to rate frogs: 16
- Deals with views for you: Yes
- Gem: Yes
- Javascript Library: Prototype
- Obtrusiveness: High. It includes all the javascript inline.
- Time investment to get working: a few minutes
- Changing the stars: Just change a line in the stylesheet that it generates
acs_as_rateable
- Github followers: 98
- Actively being updated: Not since June 2008
- README usefulness: Very low. The readme doesn’t even include what generator to run. You have to look in the code, which is fine but annoying.
- Lines of code I had to add to rate frogs from the console: 1
- Deals with views for you: No
- Gem: plugin only
- Javascript Library: Doesn’t handle views
- Time investment to get working: a few minutes
is_rateable
- Github followers: 51
- Actively being updated: Not since June 2009
- README usefulness: Low/fail. The readme says to run script/generate rateable—by_user, but this doesn’t actually work. I had to run the generator normally then edit the migration to make it work. Furthermore, the formatting is messed up on github, making it hard to copy/paste code from the browser. Of course, this is easy to work around.
- Lines of code I had to add to kind of rate frogs: 28
- Deals with views for you: Yes
- Gem: plugin only
- Javascript Library: Prototype??
- Time investment to get working: a little while. The readme didn’t accurately describe how to get it working out of the box in the way that I wanted it to. I got bored after about 5 minutes and did not feel the need to press on to get this working.
- Notes: this will only work if you have a User class, otherwise it goes by ip address. This means that if wouldn’t work for the case that I’m testing here since in my app it is a different class than User that will be doing the ratings
acts-as-rated
- Github followers:34
- Actively being updated: Not since January 2009
- README usefulness: High
- Lines of code I had to add to kind of rate frogs: 1
- Deals with views for you: No.
- Gem: plugin only. It says “coming soon” but that was about a year ago.
- Javascript Library: None. Doesn’t deal with views.
- Time investment to get working: low.
has_ratings
- Github followers:14
- Actively being updated: Not since June 2009
- README usefulness: Low. The readme contains no installation instructions.
- Lines of code I had to add to kind of rate frogs: 1
- Deals with views for you: No.
- Gem: Yes.
- Javascript Library: None. Doesn’t deal with ajax.
- Time investment to get working: low.
- Notes: This appears to be written in the style of an engine. The description is that it “demonstrates a reference implemenattion for handling ratings.” so it’s unclear if this is actually meant to be used as a plugin or gem or what.
Conclusion
There isn’t really a good solution that does jquery ratings out of the box. If you’re looking for something that uses prototype, the ajaxful ratings plugin is great, in that you can have it working in minutes. On the other hand, it is relatively obtrusive and makes me feel like I’m in 2007 in terms of javascript cleanliness. However, it’s definitely a great option.
The other options either do not handle views or are non-trivial to setup.
January 31, 2010
