code: function(errors) {
        var
          html = '<ul class="list">'
        ;
        $.each(errors, function(index, value) {
          html += '<li>' + value + '</li>';
        });
        html += '</ul>';
        return $(html);
      }
docs: template that produces error message