# Autocomplete with DB + Urgent

**URL:** <https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330>\
**Category:** Rails\
**Created:** [August 25, 2009, 8:25am UTC](https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330 "2009-08-25T08:25:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [August 25, 2009, 8:25am UTC](https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330/1 "2009-08-25T08:25:47Z")

</div>

Hello Champs,

I fetch out the values of a table (suppose users) from database and want  
to show them(user’s name) in a text-field with autocomplete…  
Can i do this in rails … If yes, then how can … ?  
Do not know any thing about it … May be you people can suggest me some  
tutorials for it as well…  
Waiting for every possible answer … 🙂

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [August 25, 2009, 9:17am UTC](https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330/2 "2009-08-25T09:17:30Z")

</div>

Yes of course you can do it.I did it recently, and I did it using jQuery  
with the plugin - [http://dyve.net/jquery/?autocomplete](http://dyve.net/jquery/?autocomplete)  
I exposed the right JSON API’s from my rails application and I had to  
tweak  
the plugin a bit to suit my needs but it works great.

There are other jQuery plugins you could have a look at too.

Thanks & Regards,  
Dhruva S…

## Mike Ditka [http://www.brainyquote.com/quotes/authors/m/mike\_ditka.html](http://www.brainyquote.com/quotes/authors/m/mike_ditka.html)

“If God had wanted man to play soccer, he wouldn’t have given us arms.”

On Tue, Aug 25, 2009 at 11:55 AM, Hemant B. \<

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [August 25, 2009, 2:29pm UTC](https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330/3 "2009-08-25T14:29:42Z")

</div>

I would begin here:

> **[Google](https://www.google.com/#hl=en&source=hp&q=rails+autocomplete&aq=f&aqi=g10&fp=c9fe100d9e542c1e)**
>
> Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.

As a personal note, I find that autocomplete works well for smaller,  
defined sets of possible inputs. People’s names can be, well, almost  
anything, and I find autocomplete obtrusive in those cases. It’s not  
really saving me anything.

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [August 26, 2009, 7:26am UTC](https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330/4 "2009-08-26T07:26:18Z")

</div>

Rails has scriptaculous and prototype built in and there are helpers  
for autocomplete already. Have a look at the API documentation for  
autocomplete.

On Aug 25, 11:25 am, Hemant B. \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [August 26, 2009, 8:25am UTC](https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330/5 "2009-08-26T08:25:01Z")

</div>

Ok … Unable to do it …  
But found another way …  
Can you guyz tell me that how to write to a file at a specific position  
…  
I mean i want to write every time at line number 3 and character number  
10 of file myfile…  
Then how can i …?

I’ll tell you the whole answer after resolving it … 🙂

Mukund wrote:

> Rails has scriptaculous and prototype built in and there are helpers  
> for autocomplete already. Have a look at the API documentation for  
> autocomplete.
> 
> On Aug 25, 11:25ï¿½am, Hemant B. \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [August 26, 2009, 10:56am UTC](https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330/6 "2009-08-26T10:56:25Z")

</div>

> **[Auto-Complete Text Fields in Rails 2](http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html)**
>
> \[Note: this entry updated to include required routing, as I failed to mention that the first time.\] In Rails 2, the PrototypeHelper and Scri...

Google is your friend. 😉

On Aug 26, 11:25 am, Hemant B. \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [August 26, 2009, 11:09am UTC](https://www.ruby-forum.com/t/autocomplete-with-db-urgent/174330/7 "2009-08-26T11:09:45Z")

</div>

Thanks a lot guyz … done it using jquery library …  
That library is using the data from a file… and then i modified that  
file according to my modification … and found solution … 🙂

Thanks for your support …

Mukund wrote:

> [Code Intensity: Auto-Complete Text Fields in Rails 2](http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html)
> 
> Google is your friend. 😉
> 
> On Aug 26, 11:25ï¿½am, Hemant B. \<rails-mailing-l…@andreas-
