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 %>
I have two main questions:
- How would I observe the collection_select and depending on what is
selected, run x or y action (automatically) - How would I merge the two inputs (I want one input that gets observed
to act as a ‘live search’)
Thanks!