robbyrussell (owner)

Fork Of

gist: 38352 by anonymous

Revisions

gist: 38353 Download_button fork
public
Public Clone URL: git://gist.github.com/38353.git
Embed All Files: show embed
helping starjugg1n in #ror.rb #
1
2
3
4
5
6
7
8
9
10
11
def auto_complete_for_search_query
  if params.has_key( :search_query ) and not params[:search_query].blank?
    search_query = "%#{params[:search_query]}%"
    @cars = Car.find( :all, :conditions => [ 'title LIKE ?', search_query ] )
    render :partial => "search_results"
  end
end
 
def search_query
  auto_complete_for_search_query
end