From c4c0163c3e02d19b6a960319add3ed045a6acfc1 Mon Sep 17 00:00:00 2001 From: Carl Date: Mon, 21 Mar 2016 20:38:17 -0700 Subject: [PATCH] Updated example override docs for def autocomplete_product_name It was missing :root => false so rendered json included an inferred root ( http://stackoverflow.com/questions/13160551/rails-render-json-1-2-3-behaving-differently-in-production-json-root ) which causes problems with plugin. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbeca52..c21a3df 100644 --- a/README.md +++ b/README.md @@ -319,7 +319,7 @@ form elements to get the values: brand_id = params[:brand_id] country = params[:country] products = Product.where('brand = ? AND country = ? AND name LIKE ?', brand_id, country, "%#{term}%").order(:name).all - render :json => products.map { |product| {:id => product.id, :label => product.name, :value => product.name} } + render :json => products.map { |product| {:id => product.id, :label => product.name, :value => product.name} }, :root => false end end