button_toGenerates a form containing a single button that submits to the URL created by the set of options.
- Rails thinks that
button_tois a safer tool for representing delete requests.
- Interesting! The button_to helper works very similarly to
<%= button_to "Delete Image", image_path(@image), method: :delete %>
<% if type == "img" %> <%= button_to "View Image", img_path(curImage), method: :get %> <%= button_to "Edit Image", edit_path(curImage), method: :get %> <% end %>