View posts for Tag: "rails 2"

rating_for – A context-based rating plugin for Rails

Today I’ve released my rating_for plugin for Rails. It allows to add multiple rating categories to one ActiveRecord model. For example if you’re building a hotel review website, the rating_for plugin can save you some work:

class Hotel < ActiveRecord::Base
  rating_for :room_service
  rating_for :quality

four_seasons = Hotel.find_by_name("Four Seasons")

rating = => 7)
marriott = Hotel.find_by_name('Marriott')
marriott.rating_for_room_service << rating

hotels = Hotel.find_where_quality_has_average_rating_of(10)

For more info and installation instructions, you should take a look at the plugin’s GitHub page:

By the way: Since we’re currently on the edge between Rails 2.3 and 3.0, I’m happy to announce that the rating_for plugin is compatible with both versions.

Any kind of feedback is welcome and if you’ve got questions, just ask!

Sorry, comments are closed for this post.