I'm guessing this is maybe a Postgres thing, but in order for the autocomplete to find all records that contain the query, instead of just finding records that begin with the query, the query in autocompleter.rb needs to be updated to this:
def autocomplete_results(query)
results = where("LOWER(#{table_name}.#{autocomplete_attribute}) LIKE ?", "%#{query.downcase}%").
order("#{table_name}.#{autocomplete_attribute} ASC")
results.map do |record|
_autocomplete_format_result(record)
end
end
Note the additional percent sign at the beginning of query.downcase. I would think this should be default, but again, maybe this is just a Postgres thing.
I'm guessing this is maybe a Postgres thing, but in order for the autocomplete to find all records that contain the query, instead of just finding records that begin with the query, the query in autocompleter.rb needs to be updated to this:
Note the additional percent sign at the beginning of query.downcase. I would think this should be default, but again, maybe this is just a Postgres thing.