Assets precompiling error with jQuery UI plugin

匆匆过客 提交于 2019-12-02 05:18:58

Remove from your Gemfile:

  gem 'jquery-rails'
  gem 'jquery-ui-rails'

And change //= require jquery.ui.all in your application.js to //= require jquery-ui

Hope that works for you!

Came across this post while trying to solve the same problem, so I thought I share my solution.

The jquery-rails gem already comes with jQuery UI and it will conflict with jquery-ui-rails gem when you try to enable this way, so you have to choose which JQuery UI to use. Checkout the jquery-rails page and look under Rails 3.1 and greater.

Here's what I did:

(1) Enable jquery-ui in application.js

//= jquery-ui

(2) Get the default theme from jquery-ui-rails gem

(2-1) In gem file add gem 'jquery-ui-rails'

(2-2) In application.css add *= jquery.ui.all

You could also develop your own theme from themeroller and use it as well.

gem 'jquery-rails', '~> 2.3.0'

remove gem 'jquery-ui-rails'

//= require jquery-ui in app.js

fixed this for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!