Skip to content

Instantly share code, notes, and snippets.

/gist:38352

Created Dec 20, 2008
Embed
What would you like to do?
def auto_complete_for_search_query
searchstring = params[:search_query];
if !searchstring.empty?
@cars = Car.find(:all, :conditions => ['title LIKE ?', "%#{params[:search_query]}%"])
end
render :partial => "search_results"
end
def search_query
auto_complete_for_search_query()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment