I wanted to add confirmation message on link_to function with Ruby.
= link_to \'Reset message\', :action=>\'reset\' ,:confirm=>\'Are you sure?\'
<%= link_to "Delete this article", article_path(article), method: :delete,
data: { confirm: "Are you sure you want to delete the
article?"}, class: "btn btn-xs btn-danger" %>
A button link where article_path
is the prefix and (article)
is passing the id
which is required by the method: :delete
method.
The later part of the codes adds a confirmation msg.