Installing jQuery in Rails 3.2.13

后端 未结 2 625
长情又很酷
长情又很酷 2021-01-22 21:47

I am having trouble getting jQuery to work on Ruby on Rails 3.2.13. I have looked at tutorials, searched youtube, etc. and I still can\'t get it to work.

More specifica

2条回答
  •  情书的邮戳
    2021-01-22 22:38

    Check your browser's console for any load error. It seems that you are not deploying the javascript, so it's not loaded.

    Either use

     <%= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" %>
    

    or have a copy of the file you are serving in any of

    /lib/assets/javascripts
    /vendor/assets/javascripts
    /app/assets/javascripts
    

提交回复
热议问题