app/controllers/customers_controller.rb
def autocomplete
    @customers = Customer.order(:name).where("name ILIKE ? and active = ?", "%#{params[:term]}%", true)
    respond_to do |format|
      format.json
    end
  end
# GET /customers/autocomplete.json
# View to get the customer autocomplete feature editing invoices.
GET /customers/autocomplete.json
View to get the customer autocomplete feature editing invoices.
GET / customers / autocomplete . json View to get the customer autocomplete feature editing invoices .
def autocomplete
    @customers = Customer.order(:name).where("name ILIKE ? and active = ?", "%#{params[:term]}%", true)
    respond_to do |format|
      format.json
    end
  end
def autocomplete @customers = Customer . order ( :name ) . where ( "name ILIKE ? and active = ?" , "%#{params[:term]}%" , true ) respond_to do | format | format . json end end
GET /customers/autocomplete.json
View to get the customer autocomplete feature editing invoices.
GET / customers / autocomplete . json View to get the customer autocomplete feature editing invoices .