Edward
Edward

Reputation: 3499

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?

Upvotes: 12

Views: 6206

Answers (1)

Jef
Jef

Reputation: 5474

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.

Upvotes: 28

Related Questions