0
我想安裝jQuery UI的,爲了做到這一點我編寫這樣的: 的Gemfile:滑軌安裝jQuery UI的
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'jquery-datatables-rails'
/app/assets/javascipts/application.js
//= require jquery
//= require jquery_ujs
//= require jquery.ui.draggable
//= require jquery.ui.droppable
//= require jquery.ui.resizable
我不想要任何jQuery樣式,所以我沒有在清單中包含任何css文件。我只希望這三種互動包括在內。
後,我已經運行:捆綁安裝和捆綁更新命令,並重新啓動服務器,我得到了以下錯誤:
couldn't find file 'jquery.ui.draggable' with type 'application/javascript'
Checked in these paths:
/old-time-turtle-app/app/assets/fonts
/old-time-turtle-app/app/assets/images
/old-time-turtle-app/app/assets/javascripts
/old-time-turtle-app/app/assets/stylesheets
/old-time-turtle-app/vendor/assets/javascripts
/old-time-turtle-app/vendor/assets/stylesheets
/old-time-turtle-app/.gems/ruby/2.3.0/gems/browser-timezone-rails-1.0.1/app/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jstz-rails3-plus-1.0.5/vendor/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/js_cookie_rails-2.1.4/vendor/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/browser-timezone-rails-1.0.1/app/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/nprogress-rails-0.2.0.2/app/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/nprogress-rails-0.2.0.2/app/assets/stylesheets
/old-time-turtle-app/.gems/ruby/2.3.0/gems/chartkick-2.2.4/app/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/chartkick-2.2.4/vendor/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/coffee-rails-4.1.1/lib/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jquery-datatables-rails-3.4.0/app/assets/images
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jquery-datatables-rails-3.4.0/app/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jquery-datatables-rails-3.4.0/app/assets/media
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jquery-datatables-rails-3.4.0/app/assets/stylesheets
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jquery-ui-rails-6.0.1/app/assets/images
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jquery-ui-rails-6.0.1/app/assets/stylesheets
/old-time-turtle-app/.gems/ruby/2.3.0/gems/jquery-rails-4.3.1/vendor/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/actioncable-5.0.5/lib/assets/compiled
/old-time-turtle-app/.gems/ruby/2.3.0/gems/turbolinks-source-5.0.3/lib/assets/javascripts
/old-time-turtle-app/app/assets/fonts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/bootstrap-sass-3.3.7/assets/stylesheets
/old-time-turtle-app/.gems/ruby/2.3.0/gems/bootstrap-sass-3.3.7/assets/javascripts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/bootstrap-sass-3.3.7/assets/fonts
/old-time-turtle-app/.gems/ruby/2.3.0/gems/bootstrap-sass-3.3.7/assets/images
看來,它看起來對這些文件和不容易找到他們,我需要手動包含.js文件?
什麼是您的rails版本? – Roshan
Rails 5.0.5 我正在碼頭工作。 – Borbat
嘗試將'jquery.ui.draggable'更改爲'jquery-ui/widgets/draggable'。 「jquery-ui-rails-6.0.1」及以上版本的路徑已經改變。 – Roshan