Hi everyone, i have the following code:
<%= form_tag :action => 'list_wedding_by_continent', :id => "Africa" %>
<%= collection_select(:thing, :continent, @continent,"id","continent") %>
<%= submit_tag 'Search' %>
<%= end_form_tag %>
how do i pass in the selected country in the list, instead of hard coding "Africa"
Forget the rails helpers for a moment and go back to HTML basics.
You've got a form (which rails can help you create using form_tag, or even better, form_for). This submits a post request to a URL (which in the rails helper can be generated with a hash of parameters, including perhaps :action => 'some_action'). The contents of that form (including, as in your case, a select box, which rails can help you create with select, select_tag, collection_select, etc) are passed to the receiving URL for it to do with what it wants.