DEV Community

Cover image for Rails 7 JS on page load
Jose V
Jose V

Posted on

Rails 7 JS on page load

After diving in many rabbit holes trying to figure out why my JS was not loading after using rails link helper link_to... I think I have the answer.

Rails guide tells us one thing however, this seems to be working for me

document.addEventListener("turbo:load", function () {
Enter fullscreen mode Exit fullscreen mode

Hope this helps you!


Top comments (1)

rtaibah profile image
Rami Taibah

Thank you for this. Helped a lot!