Skip to content
Snippets Groups Projects
Commit 921ec1c6 authored by Felipe Bombardelli's avatar Felipe Bombardelli
Browse files

Modify to use autocomplete service

parent 33b66b59
No related branches found
No related tags found
No related merge requests found
...@@ -50,8 +50,9 @@ class SearchController < ApplicationController ...@@ -50,8 +50,9 @@ class SearchController < ApplicationController
def autocomplete def autocomplete
begin begin
auto = AutocompleteService.new
query = params["q"] || "" query = params["q"] || ""
json_data = open( "http://localhost:4242?q=#{query}" ).read json_data = auto.query(query)
render text: json_data render text: json_data
rescue rescue
render text: "[]" render text: "[]"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment