Forum: Ruby on Rails Autocompleter Problems

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-02-24 06:23
(Received via mailing list)
I'm trying to get autocomplete to work but have been having some
It seems that Ajax.Autocompleter(...) is not getting called. I've put in
alert in control.js:

Autocompleter.Local = Class.create();
Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(),
  initialize: function(element, update, array, options) {
    window.alert("GOT CALLED");
    this.baseInitialize(element, update, options);
    this.options.array = array;

This does not get called at all. My code in my view is as follows:

<%= text_field_with_auto_complete(:partner, :name,{:size=>10}) %>

which produces the javascript:

var partner_name_auto_completer = new Ajax.Autocompleter('partner_name',

And in my controller:

class PartnersController < ApplicationController
  layout "default"
  auto_complete_for :partner, :name, :limit=>10

  def index
  	@title = "Partners"
    render :action => 'list'

I have liveHTTP running in the background and I'm not getting anything
it when I'm typing, so there are no HttpRequests happening.

Any help would be greatly appreciated.
Eric G.
unknown (Guest)
on 2006-02-24 06:48
(Received via mailing list)
Ok...I found my mistake.
I made the mistake of including prototype after controls. Doh!

This topic is locked and can not be replied to.