[英]Ruby on Rails: How do I specify which method a form_tag points to?
I have this: 我有这个:
<% form_tag :controller => :proposals, :method => :bulk_action do %>
but it errors in the create method... which is weird because I'm trying to tell stuff to delete. 但它在create方法中出错...这很奇怪,因为我正试图告诉材料要删除。
The :method
parameter specifies the HTTP request method . :method
参数指定HTTP请求方法 。 You're probably looking for :action
instead: 您可能正在寻找
:action
代替:
<% form_tag :controller => :proposals, :action => :bulk_action do %>
This will create a form that points to bulk_action
in ProposalsController
. 这将创建一个指向
ProposalsController
bulk_action
的表单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.