I am using a form in a rails application in order to update a record.
<%= form_with model: @article do |form| %>
<%= form.text_field :title %>
<%= form.text_area :body %>
<%= form.submit %>
<% end %>
But I don't want only one "Update" button, I would like 2 buttons (Save and Cancel). How can I do that ?
For a Cancel button, you could use a
link_toto redirect to a different page.<%= link_to 'Cancel', preferred_redirect_path %>To change the text for the
submityou can use the following.<%= f.submit "Custom Text" %>