Sha256: b3c5d455c3be1db64af337dc7502c2fefd50a188bea5eb6620347323ccad2f4a

Contents?: true

Size: 859 Bytes

Versions: 1

Compression:

Stored size: 859 Bytes

Contents

function(doc, req) {
  var head = '<html><head><link rel="stylesheet" href="../../stylesheets/application.css" type="text/css" media="screen" charset="utf-8"></head><body>';
  var body = '';
  var tail = '</body></html>';
  if(doc) {
  <% attributes.each do |attribute| %>
    if(doc['<%= attribute %>']) {
      body += '<p><strong><%= attribute.humanize %></strong>: ' + doc['<%= attribute %>'] + '</p>'
    }
  <% end %>
    return head + '<h1>Showing <%= model_name.humanize %></h1>' + body + tail;
  } else {
  <% attributes.each do |attribute| %>
    body += '<p><label><%= attribute.humanize %></label>: <input type="text" name="<%= model_name %>[<%= attribute %>]" id="<%= model_name %>_<%= attribute %>" /></p>'
  <% end %>
    body += '<p><input type="submit" /></p>'
    return head + '<h1>New <%= model_name.humanize %></h1>' + body + tail;
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

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