Auto_complete never completes, does nothing

My setup = Rails 2.0, Prototype ‘1.6.0.2’.

I have a simple implementation of auto_complete that for whatever reason
never fires off an ajax request. I found this in the ‘controls.js’:

this.element.setAttribute(‘autocomplete’,‘off’);

I commented this out, still nothing.

Here’s my code:

View:
<%= text_field_with_auto_complete :player, :name_last, { :min_chars => 1
} %>

Controller:
auto_complete_for :player, :name_last

Is there something I’m missing here? I had a colleague look into this
(veteran rails developer) and he was bewildered.

I’ve also tried using different objects and fields with the same result.

On Apr 30, 2008, at 18:43 , Matt S. wrote:

Here’s my code:
(veteran rails developer) and he was bewildered.

I’ve also tried using different objects and fields with the same
result.

Do you load the JavaScript libraries?

– fxn

Xavier N. wrote:

On Apr 30, 2008, at 18:43 , Matt S. wrote:

Here’s my code:
(veteran rails developer) and he was bewildered.

I’ve also tried using different objects and fields with the same
result.

Do you load the JavaScript libraries?

– fxn

Yep, the JS libraries load. I don’t get any JS errors either…

Xavier N. wrote:

On Apr 30, 2008, at 19:01 , Matt S. wrote:

Do you load the JavaScript libraries?

– fxn

Yep, the JS libraries load. I don’t get any JS errors either…

Everything looks fine.

The HTML autocomplete attribute is turned off to avoid triggering
browser builtin autocompletion. Leave that off.

The option :min_chars goes in the wrong hash:

text_field_with_auto_complete(
  object,
  method,
  tag_options = {},
  completion_options = {}
)

but that should fire the call anyway. You end up with and HTML
min_chars attribute, but that does not prevent the Ajax request from
being issued.

How did you check no Ajax request is sent?

– fxn

I checked both in Firebug in FF, and my scripted server terminal window
(displays all request/queries, etc.), nadda, nothing the request is
never fired. I also tried rolling back to two previous versions of
Prototype with no luck.

On Apr 30, 2008, at 19:01 , Matt S. wrote:

Do you load the JavaScript libraries?

– fxn

Yep, the JS libraries load. I don’t get any JS errors either…

Everything looks fine.

The HTML autocomplete attribute is turned off to avoid triggering
browser builtin autocompletion. Leave that off.

The option :min_chars goes in the wrong hash:

text_field_with_auto_complete(
  object,
  method,
  tag_options = {},
  completion_options = {}
)

but that should fire the call anyway. You end up with and HTML
min_chars attribute, but that does not prevent the Ajax request from
being issued.

How did you check no Ajax request is sent?

– fxn

On Apr 30, 2008, at 19:58 , Matt S. wrote:

I checked both in Firebug in FF, and my scripted server terminal
window
(displays all request/queries, etc.), nadda, nothing the request is
never fired. I also tried rolling back to two previous versions of
Prototype with no luck.

Have you moved forward?

check out your application.rb file and if there is
protect_from_forgery then just comment it.

Download the latest from scriptaculous and unizip it and put it in
your public/javascript folder and overwrite the file that exist there
already. And in your view file make sure to include
<%=javascript_include_tag ‘default’ %>
<%=javascript_include_tag ‘prototype’ %>

It works for me. Hopefully, it works for you as well.

On Fri, May 16, 2008 at 8:23 AM, Mr. Bless [email protected]
wrote:

check out your application.rb file and if there is
protect_from_forgery then just comment it.

In that case the request would fail, but it would be a request in
firebug.

I have the same problem as Matt, am running Rails2 via Aptana
RadRails, and have tried the various suggestions to no avail. Has
anyone successfully set this up on Rails 2?

On Sat, May 31, 2008 at 12:06 AM, glenviewjeff [email protected]
wrote:

I have the same problem as Matt, am running Rails2 via Aptana
RadRails, and have tried the various suggestions to no avail. Has
anyone successfully set this up on Rails 2?

Sure.

Great, I just now found time to revisit this thread i started. I
temporarily abandoned the app I was developing on when I had this
problem but will check it out asap. Thanks guys.

matt

glenviewjeff wrote:

Success! I had ignored this suggestion from Mr. Bless because I had
just installed it on the console via “script/plugin install
auto_complete”. What I failed to realize is that for whatever reason,
this does not install the latest version. When I downloaded the
archive from scriptalicious, everything worked as expected!

Thanks Mr. Bless.

Check out my blog, http://www.tipninja.com where I share tips from
optimizing your PC use, to cooking and food storage and household
organization to personal happiness.

Excuse my ignorance but where can I grab the latest version of
auto_complete? I poked around the Scriptaculious site with no luck…
pages weren’t loading or erroring… thanks in advance.

Matt S. wrote:

Great, I just now found time to revisit this thread i started. I
temporarily abandoned the app I was developing on when I had this
problem but will check it out asap. Thanks guys.

matt

glenviewjeff wrote:

Success! I had ignored this suggestion from Mr. Bless because I had
just installed it on the console via “script/plugin install
auto_complete”. What I failed to realize is that for whatever reason,
this does not install the latest version. When I downloaded the
archive from scriptalicious, everything worked as expected!

Thanks Mr. Bless.

Check out my blog, http://www.tipninja.com where I share tips from
optimizing your PC use, to cooking and food storage and household
organization to personal happiness.

Success! I had ignored this suggestion from Mr. Bless because I had
just installed it on the console via “script/plugin install
auto_complete”. What I failed to realize is that for whatever reason,
this does not install the latest version. When I downloaded the
archive from scriptalicious, everything worked as expected!

Thanks Mr. Bless.

Check out my blog, http://www.tipninja.com where I share tips from
optimizing your PC use, to cooking and food storage and household
organization to personal happiness.

Matt:

Go to http://script.aculo.us, then click on “downloads page,” in the
“Get it Already” bubble. Then click on your favorite archive format
(zip/gz/etc.) in the middle bubble labeled “current version.”

Jeff

On Jun 3, 12:05 pm, Matt S. [email protected]