Sha256: 99d8ab94d99d4eb154ee590471e3414327affb339ec759cc93c9e3dd1f39044f

Contents?: true

Size: 547 Bytes

Versions: 1

Compression:

Stored size: 547 Bytes

Contents

function(doc, req) {
  // !code mustache.js
  // !json templates/layout.mustache
  // !json templates/<%= pluralized_model_name %>/show.mustache
  
  if(doc) {
    provides("html", function() {
      var view = {
        title: "Showing <%= model_name.humanize %>",
        body: {
          title: doc.title,
          body: doc.body,
          id: doc._id
        }
      };
      
      return Mustache.to_html(templates.layout, view, { body: templates.<%= pluralized_model_name %>.show });
    });
  } else {
    return '404 not found';
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rid-0.4.0 lib/rid/generators/show/templates/show.js