# Multiple\_auto\_complete plugin

**URL:** <https://www.ruby-forum.com/t/multiple-auto-complete-plugin/69954>\
**Category:** Rails\
**Created:** [September 25, 2006, 8:23pm UTC](https://www.ruby-forum.com/t/multiple-auto-complete-plugin/69954 "2006-09-25T20:23:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_Kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ea924/32.png) [@S\_Kevin](https://www.ruby-forum.com/u/S_Kevin)\
**Post date:** [September 25, 2006, 8:23pm UTC](https://www.ruby-forum.com/t/multiple-auto-complete-plugin/69954/1 "2006-09-25T20:23:31Z")

</div>

A blog post describing a plugin I put together this morning to permit  
multiple auto\_complete helpers on the same page.

[http://www.sciwerks.com/blog/2006/09/25/multiple\_auto\_complete\_plugin/](http://www.sciwerks.com/blog/2006/09/25/multiple_auto_complete_plugin/)

\_Kevin

---

<div class="post-metadata">

**Author:** ![S\_Kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ea924/32.png) [@S\_Kevin](https://www.ruby-forum.com/u/S_Kevin)\
**Post date:** [September 25, 2006, 10:01pm UTC](https://www.ruby-forum.com/t/multiple-auto-complete-plugin/69954/2 "2006-09-25T22:01:17Z")

</div>

\_Kevin wrote:

> A blog post describing a plugin I put together this morning to permit  
> multiple auto\_complete helpers on the same page.
> 
> [http://www.sciwerks.com/blog/2006/09/25/multiple\_auto\_complete\_plugin/](http://www.sciwerks.com/blog/2006/09/25/multiple_auto_complete_plugin/)
> 
> \_Kevin

This is intresting. I have multiple auto\_complete’s running on the same  
page without any issues. You can also see an example of multiples  
running here:

[http://demo.script.aculo.us/ajax/autocompleter\_customized](http://demo.script.aculo.us/ajax/autocompleter_customized)

---

<div class="post-metadata">

**Author:** ![S\_Kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ea924/32.png) [@S\_Kevin](https://www.ruby-forum.com/u/S_Kevin)\
**Post date:** [September 25, 2006, 10:19pm UTC](https://www.ruby-forum.com/t/multiple-auto-complete-plugin/69954/3 "2006-09-25T22:19:55Z")

</div>

Leo S. wrote:

> running here:
> 
> [http://demo.script.aculo.us/ajax/autocompleter\_customized](http://demo.script.aculo.us/ajax/autocompleter_customized)
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Yeah, I need to clarify that a bit.  
multiple auto\_complete tags work fine until you try to get two that  
access the same model/attribute combination, then you get into trouble.  
This can happen if you have a form that requires multiple entries of  
the same type.

auto\_complete\_for :object, :method  
generates a method that tries to access Object.method. If object is  
‘object\_1’, then it will fail because it can’t find that model.

text\_field\_for\_auto\_complete fires off an AJAX request to  
‘on\_auto\_complete\_for\_object\_method’. If you specify do this…  
\<%= text\_field\_for\_auto\_complete :object\_1, :method %\> then it tries to  
hit a non-existent method in the controller.

\_Kevin
