This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you want to search every keyword including numbers with filterrific in rails, you can use the following search scope. | |
scope :search_query, lambda { |query| | |
return nil if query.blank? | |
terms = query.to_s.downcase.split(/\s+/) | |
terms = terms.map { |e| | |
('%'+ e.gsub('*', '%') + '%').gsub(/%+/, '%') | |
} | |
# configure number of OR conditions for provision |