1

I'm running rails 3.2, and trying to add a rating system using this: http://wbotelhos.com/raty/.

For some reason, even though I've added:

 $('#rating').raty();

to my script, and

 <div id="rating"></div>

to my html as shown at the website, I still can't see the stars.

I've added:

 //= require jquery.raty

to my application.js, and have jquery.raty.js in my javascripts folder.

I can't seem to figure out what I'm doing wrong.

I've tried using a gem: https://github.com/bmc/jquery-raty-rails and that doesn't work either

ttf
  • 53
  • 8

2 Answers2

2

Did you add the photos for the stars? Make sure that you have star-on.png and star-off.png in assets/images Also, add the following code in your html.erb file,

<script>
    $(document).ready(function() {
        $("#rating").raty({
            path: '/assets/'
        });
    })
</script>
kchoi
  • 1,205
  • 5
  • 18
  • 32
-1

You need to include the javascript call:

$('#star').raty();

in order to get

<div id="star"></div>

to show.