I use the raty plugin to display rating stars on multiple items. I initialise the rating score over a data attribute like
<span class="rating_score" data-rating="{{ review.rating}}" ></span>
then I run over the classes and I initiate raty as it follows
jQuery(".rating_score").each(function() {
$_this = jQuery(this);
console.log(($_this.attr('data-rating') ));
jQuery(this).raty({
path: '/bundles/gfx/rating/',
starOn: 'star.gif',
starOff: 'star_empty.gif',
hintList: ['1', '2', '3', '4', '5'],
scoreName: 'rating',
start: ($_this.attr('data-rating') ),
width: 13,
readOnly: true
});
});
the problem is the displayed rating value is going to be the same by each item, what is wrong in the snippet