Postgres accent insensitive LIKE search in Rails 3.1 on Heroku
问题 How can I modify a where/like condition on a search query in Rails: find(:all, :conditions => ["lower(name) LIKE ?", "%#{search.downcase}%"]) so that the results are matched irrespective of accents? (eg métro = metro). Because I'm using utf8, I can't use "to_ascii". Production is running on Heroku. 回答1: Poor man's solution If you are able to create a function, you can use this one. I compiled the list starting here and added to it over time. It is pretty complete. You may even want to remove