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.
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With