jQuery not working on Rails 3.2.8

后端 未结 4 1696
一向
一向 2021-01-19 22:07

I\'m having an issue with jQuery on Rails 3.2.8. I\'ve installed the jquery-rails gem and my application.js has the following:

//= require jquery
//= require         


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-19 22:33

    Fixed it!

    in application.html.erb, I changed the ordering of these two lines from:

    <%= stylesheet_link_tag    "application", :media => "all" %>
    <%= javascript_include_tag "application" %>
    

    to:

    <%= javascript_include_tag "application" %>
    <%= stylesheet_link_tag    "application", :media => "all" %>
    

    Now it works! I'm not quite sure why though, can anybody explain?

提交回复
热议问题