if params['search_text'].strip.length > 0
terms = params['search_text'].split.collect do |word|
@users = User.find(
:conditions => [
( ["(LOWER(email) LIKE?)"] * terms.size ).join(" AND "),
render :partial => "search"
I'm not sure how to make the algorithm more accurate.
If I have this in my database:
and I search for: 't'
It brings both of them up because they have have a t in them.
How can I make sure it's search for the exact letters in sequence,