Hi,
I''m having trouble with the new ajax features auto_complete_for and
text_field_with_auto_complete in 13.1. I''m getting the below errors
in firefox and safari. Has anyone else run into this error? Any help
would be great.
Thanks,
Jason
Safari Error:
TypeError - Value undefined (result of expression Ajax.Autocompleter)
is not an object. Cannot be used with new.
http://localhost:3000/contacts
FireFox Error:
Error: Ajax.Autocompleter is not a constructor
Source File: http://localhost:3000/contacts
Line: 73
controller:
class ContactsController < ApplicationController
auto_complete_for :contact, :name
def index
list
render :action => ''list''
end
def list
@contact_pages, @contacts = paginate :contact, :per_page => 10
end
end
model:
class Contact < ActiveRecord::Base
end
view:
<h1>test ajax contacts</h1>
<%= text_field_with_auto_complete :contact, :name %>
sql:
CREATE TABLE `contact` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(40) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `contact` (`id`,`name`) VALUES ("1","Jason");
INSERT INTO `contact` (`id`,`name`) VALUES ("2","Bob");