简体   繁体   中英

How do I get Filterrific Javascript and Assets to run on Rails 6?

I used the code from demo and the scopes and form work by themselves. When I added Materialize forms, I noticed that the form and filtering doesn't anymore.

Apparently filterrific doesn't load its javascript library (I loaded Jquery for materialize, which works fine).

From my understanding

//= require filterrific/filterrific-jquery

in assets/javascript/application.js won't work (also tried).

I also get an asset error

Asset `filterrific/filterrific-spinner.gif` was not declared to be precompiled in production.
Declare links to your assets in `app/assets/config/manifest.js`.

The gem seems Rails 6 ready (says the table on github), but there is no documentation on how to make it work with Rails 6 and WebPacker.

Add the following line to app/assets/config/manifest.js

//= link filterrific/filterrific-spinner.gif

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM