# Auto\_complete\_for and more

**URL:** <https://www.ruby-forum.com/t/auto-complete-for-and-more/147179>\
**Category:** Rails\
**Created:** [August 29, 2008, 4:06am UTC](https://www.ruby-forum.com/t/auto-complete-for-and-more/147179 "2008-08-29T04:06:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorg\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Jorg\_L](https://www.ruby-forum.com/u/Jorg_L)\
**Post date:** [August 29, 2008, 4:06am UTC](https://www.ruby-forum.com/t/auto-complete-for-and-more/147179/1 "2008-08-29T04:06:04Z")

</div>

Using the auto\_complete\_for method to fill a field is fine and dandy.  
The controller filters down the list and then you get your object.  
But what if you have a lot of the same elements in a field like last  
name?  
Once you use auto\_complete\_for you will have a picked a single object  
with that name.  
How can one then go on to a second step, and auto complete a second  
field based on the results of the first select.

Say I select last\_name “Smith”. There’s 1000 rows that come back from  
the database.  
How can a second field, likely on first\_name, be used to pare down  
those rows, preferably without going back to the database.
