# Problem using auto\_complete text field

**URL:** <https://www.ruby-forum.com/t/problem-using-auto-complete-text-field/86167>\
**Category:** Rails\
**Created:** [February 20, 2007, 11:28am UTC](https://www.ruby-forum.com/t/problem-using-auto-complete-text-field/86167 "2007-02-20T11:28:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prasanna\_Kumar\_Naga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@Prasanna\_Kumar\_Naga](https://www.ruby-forum.com/u/Prasanna_Kumar_Naga)\
**Post date:** [February 20, 2007, 11:28am UTC](https://www.ruby-forum.com/t/problem-using-auto-complete-text-field/86167/1 "2007-02-20T11:28:39Z")

</div>

Hi All

I wanted to add a search feature for my site and thought of using the  
auto\_complete text field.

The following is my table.

mysql\> desc tips;  
±------------±-------------±-----±----±--------±---------------+  
| Field | Type | Null | Key | Default | Extra |  
±------------±-------------±-----±----±--------±---------------+  
| id | int(11) | NO | PRI | NULL | auto\_increment |  
| description | text | YES | | NULL | |  
| title | varchar(100) | YES | | NULL | |  
±------------±-------------±-----±----±--------±---------------+

I have the following in the list.rhtml

…

.... .... \<%= javascript\_include\_tag "prototype" %\> .... .... .... .... Title: \<%= text\_field\_with\_auto\_complete :tip, :title %\> .... ....

and I have the following in the controller “tips\_controller.rb”

class TipsController \< ApplicationController  
auto\_complete\_for :tip, :title

def index  
list  
render :action =\> ‘list’  
end  
…  
…  
…  
end

I see a text box appearing and also a div below it.

But i dont see anything changing.

Should I add anything else ?

Thanks  
Prasanna

---

<div class="post-metadata">

**Author:** ![Prasanna\_Kumar\_Naga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@Prasanna\_Kumar\_Naga](https://www.ruby-forum.com/u/Prasanna_Kumar_Naga)\
**Post date:** [February 20, 2007, 11:51am UTC](https://www.ruby-forum.com/t/problem-using-auto-complete-text-field/86167/2 "2007-02-20T11:51:14Z")

</div>

On Feb 20, 2007, at 11:28 AM, Prasanna Kumar Nagasamudram wrote:

> I have the following in the list.rhtml
> 
> …
> 
> .... .... \<%= javascript\_include\_tag "prototype" %\>

Autocompletion needs [script.aculo.us](http://script.aculo.us) as well:

\<%= javascript\_include\_tag :defaults %\>

– fxn

---

<div class="post-metadata">

**Author:** ![Prasanna\_Kumar\_Naga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@Prasanna\_Kumar\_Naga](https://www.ruby-forum.com/u/Prasanna_Kumar_Naga)\
**Post date:** [February 20, 2007, 12:04pm UTC](https://www.ruby-forum.com/t/problem-using-auto-complete-text-field/86167/3 "2007-02-20T12:04:06Z")

</div>

Xavier N. wrote:

> On Feb 20, 2007, at 11:28 AM, Prasanna Kumar Nagasamudram wrote:
> 
> > I have the following in the list.rhtml
> > 
> > …
> > 
> > .... .... \<%= javascript\_include\_tag "prototype" %\>
> 
> Autocompletion needs [script.aculo.us](http://script.aculo.us) as well:
> 
> \<%= javascript\_include\_tag :defaults %\>
> 
> – fxn

Wow that works, thanks a lot…

- Prasanna
