   $(".vote-count[data-id=#{id}]").text(parseInt($(".vote-count[data-id=#{id}]").text()) - 1 )
 
 window.voteErrorCallback = (data) ->
+  $('body').removeClass('loading')
   $(".flash").append($("<div id=flash-error>#{data.statusText}</div>"))
 
 

  unvoteCallback.call(this, data)
$(".votable").delegate ".vote", "ajax:error", (e, data, textStatus, jqXHR) ->
  voteErrorCallback.call(this, data)

window.voteCallback = (data) ->
  $(this).attr('data-role','delete')
  $(this).attr('action',"/votes/#{data.vote.id}")
  $(this).append($('<input name="_method" type="hidden" value="delete" />'))



window.unvoteCallback = (data) ->
  $('body').removeClass('loading')
  $(this).attr('data-role','create')
  $(this).attr('action',"/votes")
  $(this).find('input[value=delete]').remove()
