Answers for "how to add a button in ruby on rails html"

4

button in rails

<%= button_to "Delete Image", image_path(@image), method: :delete %>
#first argument is the button text; the second argument is an expression of a route, and method is used to tell the form to send its payload as an HTTP DELETE action
Posted by: Guest on January-25-2020

Code answers related to "how to add a button in ruby on rails html"

Browse Popular Code Answers by Language