Sha256: 4a888f3a28e239faaec70ce55f368a658c84c8b5295e05d0cbd797a17204157c
Contents?: true
Size: 1.28 KB
Versions: 3
Compression:
Stored size: 1.28 KB
Contents
function(doc, req) { // !code path.js // !code mustache.js // !json templates/layout.mustache // !json templates/<%= pluralized_model_name %>/show.mustache // !json templates/<%= pluralized_model_name %>/form.mustache // !json templates/<%= pluralized_model_name %>/delete.mustache provides("html", function() { var view = { path: path(), body: { path: path() } }; var partial; if(doc) { <% attributes.each do |attribute| -%> view.body['<%= attribute %>'] = doc['<%= attribute %>']; <% end -%> view.body.id = doc._id; if (req.query.edit != undefined) { // edit view.title = "Editing <%= model_name.humanize %>"; partial = "form"; } else { view.body.rev = doc._rev; if (req.query['delete'] != undefined) { // delete view.title = "Deleting <%= model_name.humanize %>"; partial = "delete"; } else { // show view.title = "Showing <%= model_name.humanize %>"; partial = "show"; } } } else { // new view.title = "New <%= model_name.humanize %>"; partial = "form"; } return Mustache.to_html(templates.layout, view, { body: templates.<%= pluralized_model_name %>[partial] }); }); }
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rid-0.5.2 | lib/rid/generators/show/templates/show.js |
rid-0.5.1 | lib/rid/generators/show/templates/show.js |
rid-0.5.0 | lib/rid/generators/show/templates/show.js |