How to Pass Jquery selected dropdown values and radio button values to controller

Hi,

I have an advance search page and its code is as follows -

I have written my code like this

<%= form_tag search_index_path, method: :get do %> <%= radio_button_tag 'user_type', 'customer' %>

Customer

<%= radio_button_tag 'user_type', 'supplier' %>

Supplier

<% end %>

Search Criteria

State

<%= collection_select(:customer, :customer_number, Customer.all, :id, :state) %>

City

<%= collection_select(:customer, :customer_number, Customer.all, :id, :city) %>

Name

<%= collection_select(:customer, :customer_number, Customer.all, :id, :name) %>

State

<%= collection_select(:supplier, :supplier_number, Supplier.all, :id, :state) %>

City

<%= collection_select(:supplier, :supplier_number, Supplier.all, :id, :city) %>

Name

<%= collection_select(:supplier, :supplier_number, Supplier.all, :id, :name) %>

<%= submit_tag “Search”, name: nil %>

I have two models and controllers for customer and supplier
respectively. Now after selecting the values on search page when user
click on search how to pass these values to controller so that it will
return search results from model.

Hi,

Maybe you can check those

Rafal

2013/6/18 mugdha r. [email protected]