function(doc, req) { // !code path.js // !code mustache.js // !json templates/layout.mustache // !json templates/<%= pluralized_model_name %>/show.mustache if (!doc) { var doc = { _id: req.form.id, type: '<%= model_name %>', <% attributes.each do |attribute| -%> '<%= attribute %>': req.form['<%= attribute %>'], <% end -%> }; var view = { path: path(), title: "Created Post", body: { path: path(), <% attributes.each do |attribute| -%> '<%= attribute %>': doc['<%= attribute %>'], <% end -%> id: doc._id } }; return [doc, Mustache.to_html(templates.layout, view, { body: templates.<%= pluralized_model_name %>.show })]; } }