incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabio Batalha Cunha dos Santos <fabio.bata...@scielo.org>
Subject Re: Mustache with _views _lists
Date Mon, 20 Dec 2010 17:33:51 GMT
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 <
fabio.batalha@scielo.org> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message