Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a jquery plugin to rails 3.1

I want to use LiveFilter https://github.com/mikemerritt/LiveFilter in my rails app. It does exactly what I want to do - filter existing elements using a search box.

How would I go about adding this (or any other) jquery plugin to rails 3.1, so that it works with the asset pipeline? If you know, will it be different in 3.2?

like image 685
Edward Avatar asked Feb 01 '12 11:02

Edward


1 Answers

Add the livefilter.js file to your app/assets/javascripts directory, and add a require directive to your JS manifest(s) (e.g. application.js) :

//= require livefilter

AFAIK, the asset pipeline works the same in 3.1 and 3.2.

like image 81
Jef Avatar answered Oct 20 '22 16:10

Jef