Reputation: 1695
In my app Admin can enter a rating for each user. Im using raty js to show and also to input the star rating..
Thing is I can get an integer value through this. IM trying to set float values through this like half star and all This is what i did.. But still the output is all fullstars.. not half stars..
$('#expert_star').raty({
<% expert_score = (@expert_rating && @expert_rating.score.present?) ? @expert_rating.score : 0 %>
showHalf: true,
score: <%= expert_score %>,
readOnly: <%= expert_score > 0 ? true : false %>,
mouseover: function(score) {
console.log("Score: "+score);
}
});
Ignore the ruby codes in side jquery script
Upvotes: 2
Views: 457