Hi priya,
Hi i have a table called "streams" with columns "name" and
"interlace".
Using below code :
<select name="Interlaced">
<option>Yes</option>
<option>No</option>
</select>
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
On Dec 15, 9:13 am, sreekanth.G <[email protected]> wrote:
> 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
>
>
>
> On Fri, Dec 12, 2008 at 4:48 PM, sreekanth. G <[email protected]> wrote:
> > hi ,
>
> > i got stuck there itself,
> > can you tell me whch document/book talks about the implementation of
> > search with dropdown box params?
>
> > thanks
> > srikanth
> > On Fri, Dec 12, 2008 at 2:41 PM, sreekanth. G <[email protected]> wrote:
> >> 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 Buvan
> >> <[email protected]> wrote:
>
> >>> Codecformat:
> >>> <%=
> >>>collection_select(:destinationtable_name,:destinationcolumn_name,Sourcetablename.find(:all
> >>> ),sourcecolumn_name,:Sourcetablename) %>
> >>> Eg:
> >>> <%=collection_select(:author,:name,Book.find(:all ),author_name,:book)
> >>> %>
>
> >>> sreekanth.G wrote:
> >>>> hi ,
>
> >>>> in tried in same way but how to give the two collecton_select arrays
> >>>> in my code:
>
> >>>> i tried like this:
> >>>> --------------------------------------------------------------------------------
> >>>> codecformat:<%= select_tag
> >>>> 'codecformat',options_for_select([['mpeg2'],
> >>>> ['h264'],
> >>>> ['aac']], to_s), :onchange =>
> >>>> "content.category(this,notnull ) ;" %>
>
> >>>> combination:<%= select_tag 'category',options_for_select([['mpeg2
> >>>> 25fps'],
> >>>> ['mpeg2 30fps'],
> >>>> ['mpeg2'],
> >>>> ['1920x1080'],
> >>>> ['h264'],
> >>>> ['aac']], to_s), :onchange =>
> >>>> "content.category(this,notnull ) ;" %>
> >>>> -----------------------------------------------------
> >>>> now i have two colletion_select showned above
>
> >>>> in observe_field <%= observe_field 'category'%>
> >>>> how to give this two names:
>
> >>>> thanks
> >>>> srikanth
>
> >>>> On Fri, Dec 12, 2008 at 1:24 PM, Priya Buvan
>
> >>> --
> >>> Posted viahttp://www.ruby-forum.com/.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---