Ajay Guthikonda
Joined
1,210 Experience
12 Lessons Completed
0 Questions Solved
Activity
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 %>