I have the following view in my rails app:
<div class="row">
<div class="span11 center searchFieldContainer">
<div class="span3">
<%= collection_select :matchup, :player_1, Player.all, :id, :last_name, {}, { :multiple => false, class: "matchupSearchField", id: "player_1_search_field" } %>
</div>
<div class="span3">
<h2>VS</h2>
</div>
<div class="span3">
<%= collection_select :matchup, :player_2, Player.all, :id, :last_name, {}, { :multiple => false, class: "matchupSearchField", id: "player_2_search_field" } %>
</div>
</div>
<%= link_to "View Matchup",
findMatchup_path(:player_1 => **ID_OF_PLAYER_1**, :player_2 => **ID_OF_PLAYER_1**),
:method => :get, class: "my_class" %>
</div>
which is part of '/home.html.erb', my root_path.
How can I replace ID_OF_PLAYER_1 in the link_to with the ID of the player selected in the collection_select above? Can I use jQuery to get the value of that collection_select field?
Thanks!