Hello all,
Following a working sample.
####_show function
function(doc, req) {
// !json templates.abs
var Mustache = require('vendor/couchapp/lib/mustache');
var register = null;
register = {"article_title":doc.v12[0]["_"]};
return Mustache.to_html(templates.abs,register);
}
#####template.abs
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
{{article_title}}
</body>
</html>
Thanks,
*Fabio Batalha C. Santos*
Colegiado SciELO
www.scielo.org
FAPESP - CNPq - BIREME - FapUNIFESP
On Mon, Dec 20, 2010 at 2:34 PM, Fabio Batalha Cunha dos Santos <
[email protected]> wrote:
> Hello all!
>
> I'm new with couchdb.
>
> I'm trying to use the mustache.js instead of the template.js, but when I
> include the mustache code in my _show function or _list function the
> functions stop to work.
>
> As you can see this is a simple show function that works fine without the
> line: // !code vendor/couchapp/lib/mustache.js
>
> function(doc, req) {
> // !json templates.abstract
> // !code vendor/couchapp/lib/mustache.js
>
>
> return ("Test:"+doc.v12[0]["_"]);
>
> }
>
> If anybody have any idea about what could be wrong, blease help me.
>
> Thanks,
> *Fabio Batalha C. Santos*
> Colegiado SciELO
> www.scielo.org
> FAPESP - CNPq - BIREME - FapUNIFESP
>
>