The following link should be disabled after the first click
<%= link_to "Submit Order", {:action => "charge"}, class: 'btn btn-primary', id: 'confirmButton' %>
The following code permanently disables the link:
ready = ->
$('#confirmButton').click (e) ->
e.preventDefault()
return
$(document).ready(ready)
$(document).on('page:load', ready)
How do I have to modify this code, so that the link is active on the first click and then disabled on subsequent clicks?