Forum: Ruby on Rails Ajax.Autocompleter is not a constructor

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
70375a32ad79987b9bc00cb20f7d1c95?d=identicon&s=25 Dean (Guest)
on 2006-02-13 19:46
(Received via mailing list)
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) 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:

<input id="contact_name" name="contact[name]" size="30" type="text"
/><div
class="auto_complete" id="contact_name_auto_complete"></div><script
type="text/javascript">
//<![CDATA[
new Ajax.Autocompleter('contact_name', 'contact_name_auto_complete',
'/account/auto_complete_for_contact_name', {})
//]]>
</script>

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 --
B37049d3e61e47d2640e55242fba099a?d=identicon&s=25 Anders (Guest)
on 2006-02-13 23:31
(Received via mailing list)
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" %>
70375a32ad79987b9bc00cb20f7d1c95?d=identicon&s=25 Dean (Guest)
on 2006-02-14 00:23
(Received via mailing list)
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 --
This topic is locked and can not be replied to.