开发者

Ruby on Rails: How do I specify which method a form_tag points to?

开发者 https://www.devze.com 2023-01-06 11:39 出处:网络
I have this: <% form_tag :controller => :proposa开发者_如何学Cls, :method => :bulk_action do %>

I have this:

<% form_tag :controller => :proposa开发者_如何学Cls, :method => :bulk_action do %>

but it errors in the create method... which is weird because I'm trying to tell stuff to delete.


The :method parameter specifies the HTTP request method. You're probably looking for :action instead:

<% form_tag :controller => :proposals, :action => :bulk_action do %>

This will create a form that points to bulk_action in ProposalsController.

0

精彩评论

暂无评论...
验证码 换一张
取 消