Forum: Rails-ES auto_complete rails2

Posted by Julieta Venturini (juliventurini)
on 2012-11-10 15:07
Hola soy nueva en rails y quiero realizar un autocompletar via ajax y me
he trabado y ya no se que mas probar, espero que me puedan ayudar.

Aqui les dejo el codigo

Primero instale
script/plugin install git://github.com/rails/auto_complete.git

- CONTROLLER

class CustomersController < ApplicationController
  auto_complete_for :customer, :name

- VIEW
<%= text_field_with_auto_complete :customer, :name, {}, {:method =>
:get} %>

- Routes.rb
map.resources :customers, :collection =>
{:auto_complete_for_customer_name => :get }

Y obtengo el siguiente error mirando mi consola de firebug
ERROR: ReferenceError: Ajax is not defined

Voy a la linea y me muestra lo siguiente

var customer_name_auto_completer = new
Ajax.Autocompleter('customer_name', 'customer_name_auto_complete',
'/form/auto_complete_for_customer_name', {method:'get'}

Cualquier ayudita sera muy bienvenida!!

Gracias de antemano.

Saludos.

Juli
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.