简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM