Say I have an Article model, and in the article \'new\' view I have two buttons, \"Publish\" and \"Save Draft\".
My question is how can I know which button is clicke
it can also be done on the form_for helper like this
<%= f.submit "Publish",name: "publish", class: "tiny button radius success" %>
<%= f.submit 'Mark as Draft', name: "draft", class: "tiny button radius " %>
and the logic is the same on the controller
if params[:publish]
// your code
elsif params[:draft]
// your code
end