Sha256: 498254980d7e3eb7775015ca36cf7fec02e94a72922b4d6e5b3d7bbd3e691050

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

function(head, req) {
  provides("html", function() {
    var header = '<html><head><link rel="stylesheet" href="../../stylesheets/application.css" type="text/css" media="screen" charset="utf-8"></head><body><h1>Listing <%= pluralized_model_name.humanize %></h1><table><tr>';
    <% attributes.each do |attribute| %>
      header += '<th><%= attribute.humanize %></th>';
    <% end %>
    header += '</tr>';
    send(header);

    var row;
    while (row = getRow()) {
      var body = '<tr>';
      <% attributes.each do |attribute| %>
        body += '<td>' + row.value['<%= attribute %>'] + '</td>';
      <% end %>
      body += '</tr>';
      send(body);
    }

    var tail = '</table></body></html>';
    return tail;
  });
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
couch-0.0.4 lib/couch/generators/list/templates/list.js