whysthatso

Differentiate Between Submit Buttons Rails

Posted on July 5, 2025

insted of the form.submit, use button_tag, which will POST and also <%= button_tag “Pay now”, {class: “primary-button”, name: “submit”, value: “foo”} %>

which will result in a params hash { “submit” => “foo”} making params more easily handleable and keeps the button label uncommitted to the value.

Hey! I'll happily receive your comments via email. Thanks for reading.

Andreas Wagner
freelance System Administrator and Ruby programmer in Tallinn, Estonia