Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem jquery-ui-rails couldn't find file 'jquery.ui.all' (

I'm trying to add jquery ui datepicker to my application with help of jquery-ui-rails gem. I've checked Railscast I seem to do everything right, but i get an error upon application startup
couldn't find file 'jquery.ui.all'

Gemfile(end of it, tried to include gem in the assets group but no luck):

gem 'backbone-on-rails'
gem "jquery-ui-rails"

application.js

//= require jquery
//= require jquery_ujs
//= require underscore
//= require backbone
//= require svitla_test
//= require_tree ../templates
//= require_tree ./models
//= require_tree ./collections
//= require_tree ./views
//= require_tree ./routers
//= require_tree .
//= require jquery.ui.all

application.css

*= require jquery.ui.all
*= require_self
*= require_tree .
like image 489
Elmor Avatar asked Apr 08 '13 08:04

Elmor


2 Answers

At version 5.0 it has been changed. You can read more about it here.

version 5.0:

application.js:

//= require jquery-ui

application.css:

/*
 *= require jquery-ui
 */

version 4.x (I'm sure about 4.2.0 and 4.2.1):

application.js:

//= require jquery.ui.all

application.css:

/*
 *= require jquery.ui.all
 */
like image 175
pawel7318 Avatar answered Nov 18 '22 16:11

pawel7318


Put //= require jquery.ui.all right after //= require jquery so it will look like this

//= require jquery
//= require jquery.ui.all
//= require jquery_ujs
//= require underscore
//= require backbone
//= require svitla_test
//= require_tree ../templates
//= require_tree ./models
//= require_tree ./collections
//= require_tree ./views
//= require_tree ./routers
//= require_tree .

note that the order of which these lines are written is the order which these files are loaded.. So if you call a jquery-ui function before it knows what jquery-ui is, most likely you need to change the order a bit..

It is usually good to put infrastructure files before your own files to avoid these kind of problems

like image 26
Nick Ginanto Avatar answered Nov 18 '22 16:11

Nick Ginanto