Open knzudgt opened 5 years ago
It works for me(for rails 4), may be you need to see in chrome dev tools img src, after this check your public asset dir on availability stars files ` $(document).ready(function () { stars_activate = function() { var stars_options = { starOff: '/assets/star-off.png', starOn: '/assets/star-on.png', starHalf: '/assets/star-half.png', half: true, hints: ['very bad', 'bad', 'ok', 'good', 'very good'], noRatedMsg: 'Нет отзывов', readOnly: true }
$('div.rate_star_price_quality').raty(stars_options);
$('div.rate_star_deadline_factor').raty(stars_options);
}
stars_activate(); }); `
I am trying to use raty in my Ruby on Rails 5.1.6 application. I downloaded raty from jqueryscript.net then copied
star-half.png
,star-off.png
andstar-on.png
in app/assets/images andjquery.raty.js
in app/assets/javascripts. Then I added the following code in /app/views/users/show.html.erb:In app/assets/javascrits/custom.js I added instead the following javascript code:
The stars however do not show up. I tried to use as path
path: "/assets/images"
and to add//= require jquery.raty
toapplication.js
with no results. I even tried to add the jquery code in view, included in a<script>
tag at the very bottom of the page, but nothing changed. I would appreciate any help.