No commit activity in last 3 years
No release in over 3 years
Add the ability to give star ratings to various models.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

ActsAsStarrable

Build Status Code Climate

ActsAsStarrable is a Rails Engine that allows you to easily add ratings (stars) to your models. Being an engine, it's a full-service add-on, providing views and controllers with sane defaults that will work for most use cases. In cases where it won't work, these can be easily overridden.

To install ActsAsStarrable, add acts_as_starrable to your Gemfile and run bundle install.

The ratings model can be built by running the following:

rails g acts_as_starrable:migration
rake db:migrate

Ratings can be added to a model as follows:

class Foo < ActiveRecord::Base
  acts_as_starrable
end

Add the javascripts to your application.js

//= require jquery.rateit.min
//= require starrable

And styles to your application.css

 *= require rateit

Finally, use the stars helper method in your view to display the partial:

<%= stars(@foo) %>

ActsAsStarrable uses the RateIt jQuery plugin and conforms to the schema.org Rating and AggregateRating schemata for SEO goodness.