2017-06-07 27 views

回答

0

Rails 5.1將jQuery作爲依賴項放棄。將它添加到Gemfile中明確:

group :development do 
    gem 'xray-rails' 
    gem 'jquery-rails' # add it outside the group if you need it globally 
end 

然後將其導入的application.js:

//= require jquery 

而且可以爲Cmd + Shift + X試。