github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

pluginaweek / has_ratings

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 14
    • 0
  • Source
  • Commits
  • Network (0)
  • Downloads (5)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (5)
    • v0.3.0
    • v0.2.0
    • v0.1.0
    • v0.0.2
    • v0.0.1
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Demonstrates a reference implementation for handling ratings — Read more

  cancel

http://www.pluginaweek.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Add gemspec 
obrie (author)
Tue Jun 09 20:32:59 -0700 2009
commit  50d83db29c7ded1b65767cfa4581f8f03d0ad676
tree    97201d31cb730600b9b6c8cd92f15caef15a542f
parent  e600b651184e94b9248d60706778e4d43a4030bd
has_ratings /
name age
history
message
file .gitignore Fri Jul 04 15:49:34 -0700 2008 Ignore test/app_root/script [obrie]
file CHANGELOG.rdoc Thu Apr 30 19:38:05 -0700 2009 Tag 0.3.0 release [obrie]
file LICENSE Mon Apr 27 18:07:23 -0700 2009 Add dependency on Rails 2.3 Replace acts_as_enu... [obrie]
file README.rdoc Fri May 01 17:58:21 -0700 2009 Add required enumerate_by version to README [obrie]
file Rakefile Tue Jun 09 20:32:59 -0700 2009 Add gemspec [obrie]
directory app/ Mon Apr 27 18:07:23 -0700 2009 Add dependency on Rails 2.3 Replace acts_as_enu... [obrie]
directory assets/ Fri May 09 17:53:29 -0700 2008 Rename RatingName to RatingValue and use acts_a... [obrie]
directory db/ Mon Apr 27 18:07:23 -0700 2009 Add dependency on Rails 2.3 Replace acts_as_enu... [obrie]
file has_ratings.gemspec Tue Jun 09 20:32:59 -0700 2009 Add gemspec [obrie]
file init.rb Fri May 09 17:53:29 -0700 2008 Rename RatingName to RatingValue and use acts_a... [obrie]
directory lib/ Mon Apr 27 18:07:23 -0700 2009 Add dependency on Rails 2.3 Replace acts_as_enu... [obrie]
directory test/ Mon Apr 27 19:18:06 -0700 2009 Disable enumeration caching during tests via En... [obrie]
README.rdoc

has_ratings

has_ratings demonstrates a reference implementation for handling ratings.

Resources

API

  • api.pluginaweek.org/has_ratings

Bugs

  • pluginaweek.lighthouseapp.com/projects/13276-has_ratings

Development

  • github.com/pluginaweek/has_ratings

Source

  • git://github.com/pluginaweek/has_ratings.git

Description

Storing ratings is a pretty common task when building web applications with a community-based focus. Ratings can have names and values associated with them. This plugin demonstrate a simple way to manage what ratings can be used and how they are persisted.

Usage

Note that this is a reference implementation and, most likely, should be modified for your own usage.

Example

  user = User.find(1)
  video = Video.find(1)

  video.ratings.create(:rater => user, :value => 'poor')
  video.ratings.average   # => 1.0

Assets

Included with the plugin are image/stylesheet assets for creating raters using css as described at www.komodomedia.com/blog/2007/01/css-star-rating-redux

Testing

Before you can run any tests, the following gem must be installed:

  • plugin_test_helper

To run against a specific version of Rails:

  rake test RAILS_FRAMEWORK_ROOT=/path/to/rails

Dependencies

  • Rails 2.3 or later
  • enumerate_by 0.4.0 or later
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server