Autocomplete with DB + Urgent ..

1 view
Skip to first unread message

Hemant Bhargava

unread,
Aug 25, 2009, 2:25:47 AM8/25/09
to rubyonra...@googlegroups.com
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 .. :)
--
Posted via http://www.ruby-forum.com/.

Dhruva Sagar

unread,
Aug 25, 2009, 2:29:58 AM8/25/09
to rubyonra...@googlegroups.com
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
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 Sagar.


Mike Ditka  - "If God had wanted man to play soccer, he wouldn't have given us arms."

Ar Chron

unread,
Aug 25, 2009, 8:29:42 AM8/25/09
to rubyonra...@googlegroups.com
I would begin here:

http://www.google.com/#hl=en&source=hp&q=rails+autocomplete&aq=f&aqi=g10&fp=c9fe100d9e542c1e

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.

Mukund

unread,
Aug 26, 2009, 1:13:27 AM8/26/09
to Ruby on Rails: Talk
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 Bhargava <rails-mailing-l...@andreas-

Hemant Bhargava

unread,
Aug 26, 2009, 2:25:01 AM8/26/09
to rubyonra...@googlegroups.com
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 Bhargava <rails-mailing-l...@andreas-

--
Posted via http://www.ruby-forum.com/.

Mukund

unread,
Aug 26, 2009, 4:55:20 AM8/26/09
to Ruby on Rails: Talk
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 Bhargava <rails-mailing-l...@andreas-

Hemant Bhargava

unread,
Aug 26, 2009, 5:09:45 AM8/26/09
to rubyonra...@googlegroups.com
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:
> 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 Bhargava <rails-mailing-l...@andreas-

--
Posted via http://www.ruby-forum.com/.

Reply all
Reply to author
Forward
0 new messages