Implementacija iz Railsa:
HTML kôd:
<a href="/something" onclick="if (confirm('Are you sure that you want to change status?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;f.submit(); };return false;">Change status</a>
Naravno, koristi se helper metoda koja generise sve ovo, pa programer kuca
Kôd:
<%= link_to 'Change status', { :action => 'something'}, :confirm => 'Are you sure that you want to change status?', :post => true %>