app/controllers/spree/products_controller_decorator.rb
# TODO: move this into an API route
move this into an API route
move this into an API route
def autocomplete
    keywords = params[:keywords] ||= nil
    json = Spree::Product.autocomplete(keywords)
    render json: json
  end
def autocomplete keywords = params [ :keywords ] ||= nil json = Spree :: Product . autocomplete ( keywords ) render json : json end
TODO: move this into an API route
TODO : move this into an API route