The difference between Link_to vs Button_to in Ruby on Rails Discussion
Discussion for
The difference between Link_to vs Button_to in Ruby on Rails
Another trick is to use formaction
for having multiple buttons in the same form without using any hidden forms.
For example:
<%= form_with model: @blog_post do [form| %>
<%= form. submit "Save" %>
<%= tag.button "Publish", formaction: publish_blog_post_path(@blog_post) %>
<% end %>