rails form_tag网址路径 [英] rails form_tag url path
本文介绍了rails form_tag网址路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这看起来应该很简单,但是却一直困扰着我.
This seems like it should be so simple but it has been causing me issues.
我有一个来自模型的select_tag.我想要做的就是让一个人从下拉列表中选择他们的位置,按提交,然后转到该地点页面.
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.
这就是我拥有的
<% 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>
问题是它当然想要一个:id
,但是它不会从下面的下拉菜单中拉:id
.
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.
谢谢
推荐答案
看起来您实际上是想要GET,而不是POST参数.
Looks like you actually want to GET, not to POST the params.
form_tag installation_path, :method => :get do
这篇关于rails form_tag网址路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文