Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails 3, how add a simple confirmation dialog when user clicks a link

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.

like image 852
jpw Avatar asked Apr 03 '11 09:04

jpw


1 Answers

EDIT:
<%= link_to "Do something", {:controller => "foo", :action => "bar"}, :confirm => "Are you sure you want to do that?" %>

like image 65
Fareesh Vijayarangam Avatar answered Sep 28 '22 11:09

Fareesh Vijayarangam