Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2008 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/38352 to your computer and use it in GitHub Desktop.
Save anonymous/38352 to your computer and use it in GitHub Desktop.
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