Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- app/views/movies/show.html.erb -->
- <div id="rating">Loading rating...</div>
- <script>
- const checkRating = () => {
- fetch("<%= movie_rating_path(@movie) %>")
- .then(response => response.text())
- .then(response => {
- document.getElementById("rating").innerHTML = response;
- });
- };
- setInterval(checkRating, 2000);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement