I am developing an app that allows HR Managers rate candidates based on key indicators. I use cocoon gem to add the indicators per candidate and ratyjs to add star rating. But unfortunately, the star shows only on the first field because cocoon gem generates a new id per field. How can I get my rating to show for every candidate?
Please help!
Below is a snippet of my code
<div id="edu-rating"></div>
...
<script>
$('#edu-rating').on('cocoon:after-insert').raty({
starOn: '<%= image_path('star-on.png') %>',
starOff: '<%= image_path('star-off.png') %>',
starHalf: '<%= image_path('star-half.png') %>',
path: '',
scoreName: 'interview_candidate[education]',
space: true
});
</script>