Coder Social home page Coder Social logo

has_ratings's Introduction

has_ratings

has_ratings demonstrates a reference implementation for handling ratings.

Resources

API

Bugs

Development

Testing

Source

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

Mailing List

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.

Installation

has_ratings requires additional database tables to work. You can generate a migration for these tables like so:

script/generate has_ratings

Then simply migrate your database:

rake db:migrate

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:

To run against a specific version of Rails:

rake test RAILS_FRAMEWORK_ROOT=/path/to/rails

Dependencies

has_ratings's People

Contributors

obrie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.