Daichi Daichi Daichi Daichi - 7 months ago 78
Javascript Question

Problems with js and rais

Currently, as a review, we are making a mechanism to evaluate with five star marks, but there are problems that the number of stars increases before the page and five stars.
enter image description here

As you can see, the number of stars increases steadily as you go through the pages.
I'd like to solve this problem, but I do not know how to solve it.


<div class="listing-rate" id="average_star_rate"></div>

path: '/assets',
readOnly: true,
score: <%= @listing.average_star_rate %>

How can I solve it?
please tell me.

Answer Source

You're describing an issue common with Turbolinks. Remove Turbolinks from your application.js (or application.coffee) and try it again. Once you're stable, add Turbolinks and read the Turbolinks docs to ensure you don't run into this in prod. :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download