Transliterate accented characters in search

This commit is contained in:
Meutel 2016-08-09 11:38:25 +02:00
parent 52199af407
commit 277df57e46

View File

@ -27,7 +27,8 @@ module PreferencesHelper
end end
if @preference.term if @preference.term
conditions.push "#{sort_col} LIKE ?" conditions.push "#{sort_col} LIKE ?"
params.push "%#{@preference.term}%" search_term = ActiveSupport::Inflector.transliterate(@preference.term)
params.push "%#{search_term}%"
end end
[ conditions.join(" AND ") ] + params [ conditions.join(" AND ") ] + params
end end