Thursday, February 5, 2009

Two Buttons - One Form

Create a form with two submit buttons. Label them each differently and Rails passes the name of the one that was pressed back in params['commit'].

Useful to have one button return to the listing view while having the other button save, but leave the input form open for more data.

No comments:

Post a Comment