How do I create multiple submit buttons for the same form in Rails?
Posted
by Angela
on Stack Overflow
See other posts from Stack Overflow
or by Angela
Published on 2010-06-12T01:38:24Z
Indexed on
2010/06/12
1:42 UTC
Read the original article
Hit count: 255
ruby-on-rails
|form-submit
I need to have multiple submit buttons.
I have a form which creates an instance of Contact_Call.
One button creates it as normal.
The other button creates it but needs to have a different :attribute value from the default, and it also needs to set the attribute on a different, but related model used in the controller.
How do I do that? I can't change the route, so is there a way to send a different variable that gets picked up by [:params]?
And if I do then, what do I do in the controller, set up a case statement?
© Stack Overflow or respective owner