# Auto Complete in Rails

**URL:** <https://www.ruby-forum.com/t/auto-complete-in-rails/162955>\
**Category:** Rails\
**Created:** [March 16, 2009, 5:16am UTC](https://www.ruby-forum.com/t/auto-complete-in-rails/162955 "2009-03-16T05:16:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charanya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b5e925/32.png) [@charanya](https://www.ruby-forum.com/u/charanya)\
**Post date:** [March 16, 2009, 5:16am UTC](https://www.ruby-forum.com/t/auto-complete-in-rails/162955/1 "2009-03-16T05:16:42Z")

</div>

Hi,  
I am A newbee to rails.I want to add Auto complete facility in my  
application.I have installed Autocomplete plugin.And i have added the  
lines

auto\_complete\_for :location,:name  
in my controller

and in my view i have added

\<%= text\_field\_with\_auto\_complete :location,:name %\>

and i have got a model called Location and a table in my database called  
locations with name attribute.

I am using Rails2.1.0 and when i run the application ,there is no  
exception thrown.But no autocomplete takes place when i type on the text  
box.

Can anyone help me on this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![charanya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b5e925/32.png) [@charanya](https://www.ruby-forum.com/u/charanya)\
**Post date:** [March 16, 2009, 7:08am UTC](https://www.ruby-forum.com/t/auto-complete-in-rails/162955/2 "2009-03-16T07:08:14Z")

</div>

Charanya N. wrote:

> Hi,  
> I am A newbee to rails.I want to add Auto complete facility in my  
> application.I have installed Autocomplete plugin.And i have added the  
> lines
> 
> auto\_complete\_for :location,:name  
> in my controller
> 
> and in my view i have added
> 
> \<%= text\_field\_with\_auto\_complete :location,:name %\>
> 
> and i have got a model called Location and a table in my database called  
> locations with name attribute.
> 
> I am using Rails2.1.0 and when i run the application ,there is no  
> exception thrown.But no autocomplete takes place when i type on the text  
> box.
> 
> Can anyone help me on this?
> 
> Thanks in advance.

I myself found out the method

This link helped me out…

[http://railsforum.com/viewtopic.php?id=23188](http://railsforum.com/viewtopic.php?id=23188)
