Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add jquery-ui to a Ruby on Rails 3.1 app?

I have added //=require jquery-ui to my application.js file and that seems to give me the javascript but I can't seem to get the stylesheets to be included. If I understand it right they should go in vendor/stylesheets but how do I get them to be included?

like image 906
chris Avatar asked Jun 04 '11 14:06

chris


People also ask

Can you use JavaScript with Ruby on Rails?

Rails uses a technique called "Unobtrusive JavaScript" to handle attaching JavaScript to the DOM. This is generally considered to be a best-practice within the frontend community, but you may occasionally read tutorials that demonstrate other ways.

What is Rails jQuery Ujs?

jquery-ujs is a script, originally created for Ruby on Rails, to simplify common JavaScript actions and make it easier to execute RESTful actions through links. Even though it was created for Rails, it works perfectly with Laravel.


1 Answers

Perhaps it's easier to use the jquery-ui-rails gem (see announcement). It packages everything up so things "just work".

like image 77
Jo Liss Avatar answered Sep 21 '22 18:09

Jo Liss