Rating system - need help


#1

Hi,
I have problem with rating system, downloaded from atmosphere (https://atmospherejs.com/barbatus/stars-rating). Here is the code:

js

  Meteor.subscribe('objects');
    Template.szablon.helpers({
    helper: function(){
        return kolekcja.find();
    }
    })

html

<template name="szablon">
{{#each helper}}
    {{title}} {{> starsRating rating=4 id=title mutable=true}} <br/>
{{/each}}
</template>

i can take value of rating by this
var rating = $('#rating').data('userrating');
But question is how can i take vale of ratings to differents objects when i have a few ratings on one page like in my example and write this values to collection which take value {{title}}?
Thank you in advance for your help :smile:


#2

Hey there! I know this post is quite old, but I am curious if you ever found a solution to this issue? I am dealing with the exact same thing right now.

Thanks.


#3

Hello,
Yes, old thing, and I do not remember how I handled this issue, but when I look now on this issue I can see, that taking of value is by data-* attribute of HTML node.
So U can set some unique ids for every rating or simply set one class for all ratings and take all of them and then iterate on this.
Generally it can be get by data-* attribute.
It is depended what You need.
I hope it will help :slight_smile: