filterrific

Filterrific not filtering data

故事扮演 提交于 2019-12-25 03:40:59
问题 I am trying to use Filterrific gem to filter data. but seems like every time I type in the text field, it just refreshes page and filter. I don't want it to refresh the page and it should be instant. Model: filterrific( default_filter_params: {}, available_filters: [ :dictionary_word_filter ] ) scope :dictionary_word_filter, lambda { |dictionary_word| where("dictionary_word LIKE :search", search: "%#{dictionary_word}%") } Controller: def index dictionary_types = DimDictionary::DISPLAY_TYPE