Ruby on Rails 4 javascript not executed

后端 未结 2 2088
醉话见心
醉话见心 2021-02-09 13:11

I have a custom js file in app/assets/javascripts. This is the js file:

//app/assets/javascripts/contacts.js
//$(document).ready(functi         


        
2条回答
  •  囚心锁ツ
    2021-02-09 13:39

    With Turbolinks version 5 (starting from Rails 5) you need to use:

    $(document).on("turbolinks:load", function () {
      // YOUR CODE
    });
    

提交回复
热议问题