How to display the selected values from the drop down list menu in rails?

Dear Guys,
I have created the drop down list for state and city. Now when the user
selects the state say florida and city say miami, I want to display
these
names on the new page when the user clicks the search link. Using
link_to,
I am not able to pass these names to the new page. Ideally these
selected
names should go as :paramsbut they arent going through the url .Please
me
know if its still not clear. Thanks a lot!! Heres the code:

<%= form_for Investopp.new do |f| %>

<%= f.label
:state_id %>
<%= f.collection_select :state_id,
Investopp.year_lookup(@state_ids), :label, :value, include_blank: true
%>
<%= f.label :city_id, "city" %>
<%= f.grouped_collection_select :city_id, Investopp.year_lookup(@state_ids), :cities, :value, :id,:name, include_blank: true %>
<% end %><%= link_to 'Back', investopps_path %><%= link_to 'Search', investopps_browsedisplay_path %>

On Sun, Jul 28, 2013 at 11:38 AM, yash shah [email protected]
wrote:

I have created the drop down list for state and city. Now when the user
selects the state say florida and city say miami, I want to display these
names on the new page when the user clicks the search link. Using link_to,
I am not able to pass these names to the new page.

Correct, or at least not without JavaScript.

The easiest way is to make ‘Search’ a submit button inside the form.


Hassan S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan