-
-
Save robbyrussell/38353 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment