I have some destructive action that needs to be performed, so I believe that this is a Rails way to put such actions in PUT or POST (therefore link_to does not work, because it is only GET).
I added a button like this:
<%= button_to "Acknowledge", ack_something_path, :method => :put, :confirm => "Sure?" %>
The button works (triggers the correct action), but I can't get Rails to display a confirm dialog.
Any ideas how to do this?
UPDATE (SOLVING THE PROBLEM)
I did not mention that I included jquery as well as the prototype in HEAD (I didnβt think it mattered). BUT, when I removed jquery, a confirmation dialog appeared.
I donβt know why this is happening, but the problem is solved (so far, one way or another). jquery and prototype do not like to work together, it seems.
ruby-on-rails-3
Zabba
source share