Search function implimentaion with the tag name as the search box entry

hi ,

i am not clear about how to intergrate the logic you have given with
my application.

in my logic i have a observe_field it will take the parameter s from
arry assignd as input to this:
e.g:
search:<%= select_tag ‘category’,options_for_select([['mpeg2

25fps’],
[‘mpeg2 30fps’],
[‘mpeg2’],
[‘1920x1080’],
[‘h264’],
[‘aac’]], to_s), :onchange =>
“content.category(this,notnull ) ;” %>

from the above code the observe_field is taking the params from
category.like
<%= observe_field ‘category’,…%>
here my doubt is if i have one more dropdown box box with name
codecname how to add the name of that array with the observe_field?
can you tell me is it possible to by this way?

thanks
Srikanth

On Fri, Dec 12, 2008 at 2:19 PM, Priya B.

Hi priya,

Hi i have a table called “streams” with columns “name” and
“interlace”.

Using below code :

Yes No

using above code am creating dropdown box with fields “yes” and “no”.
Here what i want to do is if i select the interlace field as “Yes” it
should be updated in streams table while i am entering new stream
details in stream table.

thanks
Srikanth

hi ,

i have implemented search function which list out the streams when i
enter a string in the search text box.And here i am not using any
search button once i enter the string in the text box it will give the
results.

Now i want to do the search function by selecting the params from the
dropdown box and using seach button.

e.g:i have two dropdownboxes one is for name another is for resolution
,i can select the perticlar name and resolution from dropdown
boxes,now i want to search for this two strings matched in the tables
called streams.
How to link this dropdown box params as arguments to the search
function written in controller and index.html.erb?
Can you give any suggestions?

take a look at my code;

drop down box creation in index.html.erb

<%= select_tag ‘parameter_name’,
options_from_collection_for_select(Stream.find(:all), :id, :name) %>

<%= select_tag ‘parameter_name’,
options_from_collection_for_select(Stream.find(:all), :id, :resolution)
%>

here i am to get the name and resolution params in dropdownboxes.

below code gets the params to be seachd as arguments in observe_field
method,here i want to made changes to collect values from the drop
down boxes.

<%= observe_field ‘codecformat’,
:frequency => 0.5,
:update => ‘results’,
:url => { :controller => ‘streams’, :action=> ‘get_results’
},
:with => “‘search_text=’ + escape(value)”,
:loading =>
“document.getElementById(‘spinner’).style.display=‘inline’”,
:loaded =>
“document.getElementById(‘spinner’).style.display=‘none’”%>

can you help me how to impliment this functionalty?

thnaks for spending time to read and replying to my query’s.

Srikanth