You can add a button click event using javascript, which will fill in the hidden value and pass it along with the rest of the parameters. If using jQuery:
$("#post_button").click(function() { $("#form_action").val("post"); }); $("#preview_button").click(function() { $("#form_action").val("preview"); });
Then you will access the action in your controller using params['form_action']
source share