# Ajax.Autocompleter is not a constructor

**URL:** <https://www.ruby-forum.com/t/ajax-autocompleter-is-not-a-constructor/53695>\
**Category:** Rails\
**Created:** [February 13, 2006, 7:46pm UTC](https://www.ruby-forum.com/t/ajax-autocompleter-is-not-a-constructor/53695 "2006-02-13T19:46:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@dean](https://www.ruby-forum.com/u/dean)\
**Post date:** [February 13, 2006, 7:46pm UTC](https://www.ruby-forum.com/t/ajax-autocompleter-is-not-a-constructor/53695/1 "2006-02-13T19:46:35Z")

</div>

Hi Rails,

I am having trouble setting up an autocomplete text field. Using rails  
1.0.0  
and just trying to copy the simple scriptaculous demo  
([http://demo.script.aculo.us/ajax/autocompleter](http://demo.script.aculo.us/ajax/autocompleter)) fails. My view and  
controller  
are set up the same way.

In firefox 1.0.4 (and safari, don’t remember the version) I get the  
Ajax.Autocompleter error in the javascript console when loading the  
page. Here  
is the code that text\_field\_with\_auto\_complete generates for me:

I made no changes to the public/javascripts.

## Any suggestions? Thanks, –Dean

## Take your time, take your chances [3278.7 km, 273.4] Apparent Rennerian

It matters not how strait the gate, / How charged with punishments the  
scroll,  
I am the master of my fate: / I am the captain of my soul. –  
Invictus –  
– William E  
Henley –

---

<div class="post-metadata">

**Author:** ![dean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@dean](https://www.ruby-forum.com/u/dean)\
**Post date:** [February 13, 2006, 11:31pm UTC](https://www.ruby-forum.com/t/ajax-autocompleter-is-not-a-constructor/53695/2 "2006-02-13T23:31:49Z")

</div>

You probably need to include controls.js in your layout or view template  
in addition to prototype and effects:

\<%= javascript\_include\_tag “prototype”, “effects”, “controls” %\>

---

<div class="post-metadata">

**Author:** ![dean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@dean](https://www.ruby-forum.com/u/dean)\
**Post date:** [February 14, 2006, 12:23am UTC](https://www.ruby-forum.com/t/ajax-autocompleter-is-not-a-constructor/53695/3 "2006-02-14T00:23:26Z")

</div>

Anders wrote:

> You probably need to include controls.js in your layout or view template  
> in addition to prototype and effects:
> 
> \<%= javascript\_include\_tag “prototype”, “effects”, “controls” %\>

_sheepish grin_ Yep that was it. Layouts make it easy to forget  
things.  
Thank you.

## –Dean

## Take your time, take your chances [3278.7 km, 273.4] Apparent Rennerian

It matters not how strait the gate, / How charged with punishments the  
scroll,  
I am the master of my fate: / I am the captain of my soul. –  
Invictus –  
– William E  
Henley –
