Problem with autocomplete

The another problem i solved, because just have to render the view

<%= text_field_with_auto_complete :alergias_paciente, :alergia_nombre,
{ :size =30 },
{ :url =alergia_path(:js), :method =:get, :param_name =
‘search’} %>

alergia controller
def index
@alergias = Alergia.find(:all, :conditions =[‘nombre LIKE ?’,

alergias_paciente model

def alergia_nombre
return alergia.nombre if alergia
end map.resources :alergias_pacientes
def alergia_nombre=(nombre)
self.alergia = Alergia.find_by_nombre(nombre) unless nombre.blank?

def index
@alergias = Alergia.find(:all, :conditions =[‘nombre LIKE ?’,

routes rb map.resources :alergias_pacientes


<%= javascript_include_tag :defaults %>

js shows me alergias but it does not autocomplete the form the
I remove formated because it tell me, was deprecated. in the other
without the
formated continues ok. as if it sought to apply the js or maybe is wrog
the way i map or something like that
what do you say?