ParsaLabs | Blog

A publication about the web and more.

jQuery UI and Rails

| Comments

It seems like jQuery UI library has been removed from the latest versions of Rails. But no worries, it can be easily added back to your app through the jquery-ui-rails gem (in 3 quick steps):

(1) Add to your Gemfile:

1
gem 'jquery-ui-rails'

and run bundle install.

(2) Add the following line to your application.js file:

1
//= require jquery.ui.all

(3) And finally, add the following line to your application.css file:

1
*= require jquery.ui.all

And you are done!

Note:

If loading the entire library is an overhead for you, and you prefer to selectively load individual components you need, you can do so like this:

application.js :

1
//= require jquery.ui.datepicker

application.css :

1
2
3
/*
 *= require jquery.ui.datepicker
 */

to, for example, load the date picker module.

Comments