NullVoxPopuli
NullVoxPopuli

Reputation: 65143

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.

Upvotes: 0

Views: 71

Answers (1)

P&#228;r Wieslander
P&#228;r Wieslander

Reputation: 28934

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.

Upvotes: 1

Related Questions