asceth / acts_as_rateable Goto Github PK
View Code? Open in Web Editor NEWRating system
License: MIT License
Rating system
License: MIT License
Acts As Rateble ============= Acts_as_rateable is a plugin released under the MIT license. It makes activerecord models rateable through a polymorphic association and optionally logs which user rated which model. In this case, one user can rate an object once. Used on cotcot.hu for article rating, sponsored quizzes, etc. Example ======= Install the plugin into your vendor/plugins directory, insert 'acts_as_rateable' into your model, then restart your application. class Post < ActiveRecord::Base acts_as_rateable end Now your model is extended by the plugin, you can rate it ( 1-# )or calculate the average rating. @post.rate_it( 4, current_user.id ) @post.average_rating #=> 4.0 @post.average_rating_round #=> 4 @post.average_rating_percent #=> 80 @post.rated_by?( current_user ) #=> rating || false Post.find_average_of( 4 ) #=> array of posts See acts_as_rateable.rb for further details! Copyright (c) 2007 Ferenc Fekete, http://xpnindustries.com , released under the MIT license
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.