Autocomplete broken after update to Rails 1.0

When I upgraded to 1.0, I broke autocomplete on a field. I’ve done
everything that I can think of to fix the problem, but nothing has
worked. I’m able to recreate a simple autocomplete from examples on the
various tutorials, but my original code just will not work.

The only thing that stands out to me is the //<![CDATA[ tag.

Any ideas?

Thanks!

rather than try to incorporate bits of js code within your objects, why
not just load the javascript at the top of your view_code_file or
layout_file completely?

i.e.

<%= javascript_include_tag :defaults %>

after which, all I need to do to use autocomplete is a simple
definition…

<%= text_field_with_auto_complete :placement, :cmwholename, {} %>

and of course, have the necessary code in the controller to handle it.

Craig

That is what I’ve done. What I pasted above is the resulting code
generated and sent to the browser. I have the following in a file
called _form.rhtml generated from a scaffold and further modified.

<%= text_field_with_auto_complete :incident, :first_party_name %>

The thing is this worked fine before. Now I don’t even get an error in
the JS console.

On Mon, 2006-03-13 at 18:20 +0100, John Cabrer wrote:

new Ajax.Autocompleter(‘incident_first_party_name’,
‘incident_first_party_name_auto_complete’,
‘/incidents/auto_complete_for_incident_first_party_name’, {})
//]]>

The only thing that stands out to me is the //<![CDATA[ tag.

Any ideas?


rather than try to incorporate bits of js code within your objects, why
not just load the javascript at the top of your view_code_file or
layout_file completely?

i.e.

<%= javascript_include_tag :defaults %>

after which, all I need to do to use autocomplete is a simple
definition…

<%= text_field_with_auto_complete :placement, :cmwholename, {} %>

and of course, have the necessary code in the controller to handle it.

Craig