what is the easiest way in rails 3 to to ask "Are you sure you want to do that?" when the user clicks on a link?
the link in this case overwrites some data with a new value. It's a simple link_to (GET) back to the same controller method, with a param[] added.
EDIT:<%= link_to "Do something", {:controller => "foo", :action => "bar"}, :confirm => "Are you sure you want to do that?" %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With