Hey there!
First of all, thank you for making this. Of all the plugins I could find, this one seems the most useful for my purposes.
I'm having a little trouble running this RoR.
I've imported four files into my project. "bootstrap-ratings" ,"bootstrap-ratings.min" and "Gruntfile" javascripts in my application.js file, and "bootstrap-rating.css into mi application.scss file.
application.js
//= require jquery //= require jquery_ujs //= require turbolinks //= require_tree . //= require bootstrap-sprockets //= require bootstrap.min //= require bootstrap-rating //= require bootstrap-rating.min
aplication.scss
@import "bootstrap"; @import "bootstrap.min"; @import "bootstrap-rating";
When I use in my view, it looks fine, but if I try to use $('input').rating(2);
for example (setting the rating to default to 2) in my reviews.coffee file ('Reviews' is the controller I'm using in this project) I get the following error.
Uncaught TypeError: $(...).rating is not a function
Also, if I try to attach an event, like in the example:
$('input').on('change', function () {
alert('Rating: ' + $(this).val());
});
I'm getting SyntaxError: [stdin]:5:25: reserved word "function"
What am I doing wrong? Any help is greatly appreciated.