user984621
user984621

Reputation: 48511

Rails 4 - how to install "jquery-ui"?

For using jquery autocomplete plugin, I need to install jquery-ui gem.

So far, I had in my gemfile following:

gem 'jquery-rails'

So I added:

gem 'jquery-ui-rails'

And to application.js I added:

//= require jquery
//= require jquery_ujs
//= require jquery-ui

and to application.css:

 *= require_self
 *= require jquery.ui

bundle update, restart server and:

couldn't find file 'jquery.ui'

I am using in the app also turbolinks. Do I miss a gem something or something in order to make jquery-ui work in the app?

Thanks.

EDIT:

All jquery-related stuff in tehe Gemfile:

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

Upvotes: 13

Views: 8156

Answers (4)

DavidA26
DavidA26

Reputation: 161

To update this answer, the current convention is:

//= require jquery-ui

and for css:

/*
*= require jquery-ui
*/

for specific modules:

//= require jquery-ui/draggable

See latest docs here for more configuration options

Upvotes: 2

Haris Krajina
Haris Krajina

Reputation: 15296

In application.js you need to add:

//= require jquery.ui.all

or for specific components e.g.

//= require jquery.ui.sortable

Upvotes: 5

htkaya
htkaya

Reputation: 245

You need to describe which component you want to use. You can add

application.js

//= require jquery.ui.all

application.css

*= require jquery.ui.all

these lines for all component

Upvotes: 1

Anthony
Anthony

Reputation: 15987

In application.css it should be

 *= require jquery-ui

Upvotes: 6

Related Questions