       show:
         effect: 'fadeIn'
         duration: 150
+    templates:
+      error:
+        messages: window.HoganTemplates['jquery/plugins/formify/templates/error/messages']
     debug: false
 
   # === Public ===

    @elements      = @form.find '.element'
    @submit        = @form.find 'a.submit'

    @errorMessagesTemplate = window.HoganTemplates['jquery/plugins/formify/templates/error/messages']

    initialize.call @

    return


  # === Events ===

  onSubmitClick: (event) =>
    do @form.submit if not do @isLocked

    false

  onFormSubmit: (event) =>
    url = @form.data 'public-submission-url'

    if url
      request = $.ajax
        url: url
        type: 'POST'
        data: do @form.serialize
        dataType: 'json'
        beforeSend: @beforeRequestSend

      request.done @onRequestDone

      request.fail @onRequestFail

    false

  beforeRequestSend: (xhr, settings) =>
    cleanup.call @
