Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find jquery-ui in rails engine (jquery-rails gem)

I'm using the jquery-rails gem. In a rails (non-mountable) engine I have in app/assets/javascripts/my_engine/application.js.erb:

//= require jquery
//= require jquery_ujs
//= require jquery-ui.min

And I get the error:

Sprockets::FileNotFound: couldn't find file 'jquery-ui.min'\n  (in /home/me/rails/my_engine/app/assets/javascripts/my_engine/application.js.erb

The same set up was working fine in the container application. How is it that the manifest can find jquery and jquery_ujs but not jquery-ui.min?

I have the jquery-rails gem in my container app's Gemfile, in the engine's gemspec and in the engine's Gemfile and ran bundle install.

like image 270
rigyt Avatar asked May 30 '13 11:05

rigyt


2 Answers

If you're using version 3.0.0 or newer of jquery-rails, jQuery UI has been removed from the gem.

See commit 2fdcdb2633cbc6426d412c050200fc31d14b9a3b.

It looks like the creators of jquery-rails recommend taking a look at the jquery-ui-rails gem if you still need jQuery UI in your app.

like image 109
Chris Peters Avatar answered Sep 25 '22 15:09

Chris Peters


To use jquery.ui.all you need to add following gem in to your gemfile, not it is seprated from jquery_rails.

gem "jquery-ui-rails", "~> 4.0.5"

use following in your application.js to access

//= require jquery.ui.all

Best luck!

like image 26
Rameshwar Vyevhare Avatar answered Sep 23 '22 15:09

Rameshwar Vyevhare