This seems like it should be so simple but it has been causing me issues.
I have a select_tag that pulls from a model. All I want to is have a person choose their location from the drop down, press submit and take it to that places page.
Here is what I have
<% form_tag installation_path do %>
<%= select_tag :id, options_from_collection_for_select(Installation.find(:all), :id, :name) %>
<div id="button">
<p>
<%= submit_tag "Go", :name => nil %>
</p>
</div>
The problem is it of course wants an :id
but it won't pull the :id
from the drop down menu below.
What am I doing wrong, any other suggestions on the "right" way to do this.
Thanks
Looks like you actually want to GET, not to POST the params.
form_tag installation_path, :method => :get do
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With