     $(this).attr("href") != "#"
 
   # Form errors
-  loadingInterval = null
-  loadingCount = 0
   $("form")
     .on "submit", (e, xhr) ->
       message = $(this).data("loading-text")

        $loading
          .find(".loader").text(message).end()
          .addClass "active"

        loadingInterval = setInterval ->
          $loading
            .find(".loader").html("#{message}<br><small>(elapsed time: #{++loadingCount} seconds)<small>").end()
        , 1000
    .on "ajax:error", (e, xhr) ->
      $form = $(this)
      response = JSON.parse(xhr.responseText)

        $el.closest(".field")
          .addClass("error")
          .append("<small class='helper'>#{errors.join(', ')}.</small>")
 