# Using a combo box for a ajax search

**URL:** <https://www.ruby-forum.com/t/using-a-combo-box-for-a-ajax-search/132402>\
**Category:** Rails\
**Created:** [March 19, 2008, 6:58pm UTC](https://www.ruby-forum.com/t/using-a-combo-box-for-a-ajax-search/132402 "2008-03-19T18:58:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![megax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/94ad74/32.png) [@megax](https://www.ruby-forum.com/u/megax)\
**Post date:** [March 19, 2008, 6:58pm UTC](https://www.ruby-forum.com/t/using-a-combo-box-for-a-ajax-search/132402/1 "2008-03-19T18:58:27Z")

</div>

I have a ajax search set up that works very well but I can only search  
one thing.

code im using

Search:

![]()

\<%= observe\_field ‘search\_form’,  
:frequency =\> 0.5,  
:update =\> ‘results’,  
:url =\> {:controller=\>‘ratings’, :action=\>  
‘get\_results’},  
:with =\> “‘search\_text=’ + escape(value)”,  
:loading =\>  
“document.getElementById(‘spinner’).style.display=‘inline’”,  
:loaded =\>  
“document.getElementById(‘spinner’).style.display=‘none’” %\>

Where action is I was wondering if I could set up a combo box so I could  
switch between methods in the controller and whats selected in the box  
would be used for the action. I would can the moethods to make it more  
meaning full for the user.
