Spyros
Spyros

Reputation: 48626

Two Submit Buttons to Different Controller Form

i want to create a form that has two submit buttons, but each one of them submits to a different action of a different controller. I would prefer not to handle this in a single action and redirect according to the submitted button.

Is this possible ? I cannot really find any Rails like solution that does not involve javascript and such dynamic techniques.

Upvotes: 1

Views: 648

Answers (1)

Reactormonk
Reactormonk

Reputation: 21690

A <form> can have only one action, you can submit a form to one url only. So you need javascript to change the action attribute depending on button or do it on the server.

Upvotes: 3

Related Questions