Skip to content

jayanezj/rails-rateit

 
 

Repository files navigation

Rails RateIt Gem VersionBuild Status

Rails wrapper for the jQuery RateIt plugin with improved SVG images!

demo

Installation

Add this line to your application's Gemfile:

gem 'rails-rateit', '~> 1.0.22', github: 'berikin/rails-rateit'

and run bundle install.

Or install it yourself as:

gem install rails-rateit

Usage

In your application.css, include the css file:

/*
 *= require rateit
 */

In your application.js, include the js file:

//= require jquery.rateit

Or simply use the javascript and stylesheet generator:

rails generate rateit:install

In you view, use the rateit_tag helper :

<%= number_field_tag(:rating, nil, {min: 0, max: 4, step: 1, id: "my_object_rating"}) %>
<%= rateit(extra: {:"data-foo" => "bar"}, type: "div", backingfld: "#my_object_rating", max: 4, min: 0, step: 1, resetable: "false") %>


<%= number_field_tag(:rating, 4, {min: 0, max: 10, step: 1, id: "my_object_rating2"}) %>
<%= rateit(type: "span", backingfld: "#my_object_rating2", max: 10, min: 0, step: 0.5, resetable: "true", value: "2", ispreset: "true") %>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Rails wrapper for the jQuery RateIt plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 57.1%
  • CSS 30.9%
  • Ruby 11.5%
  • Other 0.5%