Topic: Change coffeescript variable with onclick
Hi,
Been working on this all weekend and need some help. Anyone know why this not working?
Coffee:
confirmExit = ->
"You have unsaved changes!" if needToConfirm
needToConfirm = true
window.onbeforeunload = confirmExit
View:
<%= f.submit 'Save', class: "btn btn-large btn-primary", onclick: "needToConfirm = false" %></p>
I want to set needToConfirm to false if user clicks save button...
Last edited by dcastellano1 (2013-03-03 20:03:57)