I have a form_for @object with two buttons.
As long as the first button displays the "show action", the second button displays the same form again. Therefore, I would like the latter to be processed by ajax.
Is it possible to have a non-ajax button and ajax button in the same form, or do I need to change the strategy?
Maybe I need a form_for with 'remote: true' so that both buttons are ajax, but then how could I control the first button to display the correct “show view”?
Or maybe the only real solution is to have two different forms?
Thank.
source
share