App.ErrorsHelper = Ember.Helper.helper (params, options)->
  errors = params[0]
  return "" unless errors and errors.length
  result = ""
  model_name = options.includeAttribute
  for error in errors
    if typeof error is "string"
      message = error
    else
      if model_name
        attribute = ttry("attributes.#{model_name}.#{error.attribute}")
        message = "#{attribute} #{error.message}"
      else
        message = error.message
    result += "<div class='error'>#{message}</div>"
  result.htmlSafe()
