   go: (e) ->
     e.preventDefault()
     $('#go', @$el).addClass('loading').html('Creating Account&hellip;')
-    
+
     @cleanUpForm()
 
     model = new Cu.Model.User

  className: 'sign-up'
  events:
    'click #go': 'go'

  render: ->
    @el.innerHTML = JST['sign-up']()

        for key of response
          $("##{key}").after("""<span class="help-inline">#{response[key]}</span>""").parents('.control-group').addClass('error')

  cleanUpForm: ->
    $('.control-group.error', @$el).removeClass('error').find('.help-inline').remove()

  keyupShortName: (e) ->
    if $(e.target).val() == ''
      $(e.target).removeClass('edited')
    else
      $(e.target).addClass('edited')

  keyupDisplayName: ->
    # "is" is a reserved word in coffeescript, so we use
    # long form method notation for the .is() jQuery function!!
    if not $('#shortName')['is']('.edited')
      username = $('#displayName').val()
      username = username.toLowerCase().replace(/[^a-zA-Z0-9-.]/g, '')
      $('#shortName').val(username)
