function(doc, req) { var head = '
'; var body = ''; var tail = ''; if(doc) { <% attributes.each do |attribute| %> if(doc['<%= attribute %>']) { body += '<%= attribute.humanize %>: ' + doc['<%= attribute %>'] + '
' } <% end %> return head + ':
' <% end %> body += '' return head + '