# Auto\_complete\_for - return id

**URL:** <https://www.ruby-forum.com/t/auto-complete-for-return-id/107948>\
**Category:** Rails\
**Created:** [June 27, 2007, 7:43pm UTC](https://www.ruby-forum.com/t/auto-complete-for-return-id/107948 "2007-06-27T19:43:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 27, 2007, 7:43pm UTC](https://www.ruby-forum.com/t/auto-complete-for-return-id/107948/1 "2007-06-27T19:43:59Z")

</div>

I’m using an auto\_complete\_for. Is there an easy way to return the id of  
the item the user selects from the list?

For example - I have an auto complete drop down that has 3 items in it.

phones  
computers  
monitors

when the user types in “p” it shows “phones” in the auto complete. When  
I click enter I want to view phones so I need to pass the id to the  
appropriate action. How do I pass the id using auto complete? Is there  
a better way to do this?

I basically want it to work similar to the typical drop down but I also  
want auto complete.

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 27, 2007, 8:03pm UTC](https://www.ruby-forum.com/t/auto-complete-for-return-id/107948/2 "2007-06-27T20:03:38Z")

</div>

On Jun 27, 2007, at 7:43 PM, David M. wrote:

> want auto complete.  
> That’s provided by model\_auto\_completer:

[http://agilewebdevelopment.com/plugins/model\_auto\_completer](http://agilewebdevelopment.com/plugins/model_auto_completer)

– fxn

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 27, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/auto-complete-for-return-id/107948/3 "2007-06-27T21:54:17Z")

</div>

Thank you.

I’ve actually never installed a plugin and have been having trouble  
connecting to the rubyforge repository through creating a new repository  
location through radrails. Do you have any suggestions?

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 28, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/auto-complete-for-return-id/107948/4 "2007-06-28T16:42:13Z")

</div>

thanks…I get this error:

svn: Can’t connect to host ‘[rubyforge.org](http://rubyforge.org)’: No connection could be made  
because  
the target machine actively refused it.

is there some sort of log in process?

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 28, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/auto-complete-for-return-id/107948/5 "2007-06-28T19:45:11Z")

</div>

On Jun 28, 2007, at 4:42 PM, David M. wrote:

> thanks…I get this error:
> 
> svn: Can’t connect to host ‘[rubyforge.org](http://rubyforge.org)’: No connection could be  
> made  
> because  
> the target machine actively refused it.
> 
> is there some sort of log in process?

You could try again with -v:

script/plugin -v install URL

– fxn

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 28, 2007, 12:35am UTC](https://www.ruby-forum.com/t/auto-complete-for-return-id/107948/6 "2007-06-28T00:35:06Z")

</div>

On Jun 27, 2007, at 9:54 PM, David M. wrote:

> I’ve actually never installed a plugin and have been having trouble  
> connecting to the rubyforge repository through creating a new  
> repository  
> location through radrails. Do you have any suggestions?

The usual idiom is to cd into the root directory of your Rails  
application and execute this command:

script/plugin install svn://rubyforge.org/var/svn/model-ac/trunk/  
vendor/plugins/model\_auto\_completer

Please note that is a single line, in case the mail gets wrapped.

– fxn
