Hi, currently I have two separate search fields. One searches the
paginated model and the other searches a user model:
<% form_for :post, :method => 'get' do %>
<%= collection_select(:post, :id, @posts, :id, :title, options ={:prompt
=> "-Select categories-"}, :class=>"category_dropdown_list") %>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", :name => nil %>
<% end %>
<input type="text" id="search_form" name="search" style="width:100%;" />
<%= observe_field 'search_form',
:frequency => 0.5,
:url => { :controller => 'auth_user', :action => 'get_results' },
:loading => "Element.show('indicator_gif_id')",
:complete => "Element.hide('indicator_gif_id')",
:with => "'search_text=' + escape(value)" %>
I have two main questions:
1) How would I observe the collection_select and depending on what is
selected, run x or y action (automatically)
2) How would I merge the two inputs (I want one input that gets observed
to act as a 'live search')
Thanks!
--
Posted via
http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk@...
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en-~----------~----~----~----~------~----~------~--~---