# Autocompletion.local inside rails while generating a dynamic list

**URL:** <https://www.ruby-forum.com/t/autocompletion-local-inside-rails-while-generating-a-dynamic-list/123625>\
**Category:** Rails\
**Created:** [December 19, 2007, 9:23am UTC](https://www.ruby-forum.com/t/autocompletion-local-inside-rails-while-generating-a-dynamic-list/123625 "2007-12-19T09:23:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kei\_Simone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/839c29/32.png) [@Kei\_Simone](https://www.ruby-forum.com/u/Kei_Simone)\
**Post date:** [December 19, 2007, 9:23am UTC](https://www.ruby-forum.com/t/autocompletion-local-inside-rails-while-generating-a-dynamic-list/123625/1 "2007-12-19T09:23:41Z")

</div>

Hi,

I am a big noob but I would like to know how to achieve the following  
2 things:

1. I need to use autocompletion.local to increase speed of retrieval  
since i only have items of no more than 30.

However, I want the list of possible items to be dynamic ie if I  
should refresh the page, the javascript array of items will be  
regenerated.

Similar to the lightning fast autocomplete eg in Rails recipes.

but the @headers have been deprecated causing the eg not to work in  
1.2.6 rails. Even when i switch to headers, the eg still did not work.  
Please advise.

1. Other than that, I need the autocompletion.local to do the  
following.

Similar to the way google finance looks up the stock symbol.

My autocomplete list search will display 2 parameters similar to  
google finance like:

\<symbol for stock 1\>\<name for stock 1\>  
\<symbol for stock 2\>\<name for stock 2\>  
…

OR

\<property1 of itemModel 1\>\<property2 of itemModel 1\>  
\<property1 of itemModel 2\>\<property2 of itemModel 2\>  
…

and I need my search to be done such that its searching through both  
symbols and names, basically 2 different parameters.

and when i choose any item, it should only display one of the 2  
parameters inside the textbox.

So sorry I am asking so much. But i tried googling and I was not  
successful. Perhaps I am not using the right key words.

Thank you all.
