Rails Filterrific-实时更新不起作用 [英] Rails Filterrific - live update not working

查看:78
本文介绍了Rails Filterrific-实时更新不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

view API中,此处 ,如果我输入class: 'filterrific-periodically-observed',那么无论我输入什么搜索字符串,它都会更新 live (无需按Enter键).

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).

但是,在我的代码中,它没有实时更新;相反,我必须按 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).

这是我的代码!

 #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 %>

关于此问题,我进行了很多搜索,但是没有找到关于 filterrific 的特定内容.我错过了重要的一步吗?

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

感谢您的帮助!

推荐答案

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

You probably forgot to add the following line to 'app/assets/javascripts/application.js':

//= require filterrific/filterrific-jquery

这篇关于Rails Filterrific-实时更新不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆