简体   繁体   中英

Rails Filterrific - live update not working

It says here , in the view API, that if I put class: 'filterrific-periodically-observed' , then whatever search string I put, it updates live (without the need of pressing enter).

However, in my code, it does not live update; rather, I have to press enter to trigger a search (which works, but would be very nice with live updates).

Here is my code!

 #index.html.erb

<%= form_for_filterrific @filterrific, :html => { class: 'ui form' } do |f| %>
    <%= f.text_field :search_query, class: 'filterrific-periodically-observed', placeholder: 'search by name, merc or map' %>
    <%= link_to 'Reset filters', reset_filterrific_url, class: 'ui inverted basic button', id: 'reset-filters' %>
    <!--<%= link_to 'cancel', '#', :class => 'ui inverted basic button', id: 'cancel-button-search', remote: true %>-->
<% end %>

I searched a lot regarding this issue, but I didn't find anything specific to filterrific . Did I miss an important step?

Thanks for the help!

您可能忘记了将以下行添加到“ app / assets / javascripts / application.js”:

//= require filterrific/filterrific-jquery

Maybe you forgot to put <div id="filterrific_results"> in your partial, like so:

<%# app/views/YOUR_MODEL/_YOUR_PARTIAL.html.erb %>
<div id="filterrific_results">
  #your partial here
</div>

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