Hi Chris, In CouchDBX 0.9 on Leopard adding ?format=html hangs and then gives foll error {"error":"noproc","reason":"{gen_server,call,\n [couch_query_servers,{ret_proc,<<\"javascript\">>,<0.16450.0>}]}"} Same behavior when you remove the xml: key/val pair and leave just the html: I don't see anything in the code or the template that may be a problem do you ? Nitin 37% of all statistics are made up on the spot ------------------------------------------------------------------------------------- Nitin Borwankar nborwankar@gmail.com On Fri, Jul 24, 2009 at 2:49 PM, Chris Anderson wrote: > On Fri, Jul 24, 2009 at 12:19 PM, Nitin Borwankar > wrote: > > Hi guys, > > > > so the list/show coding is going well - have the show running except for > one > > blocker - I am using curl to invoke the show (alost identical to example) > in > > couch app as follows - change dthe name from example to show_details in > both > > the shows code and lib/template - id in this request is "aacosta" - the > > template just returns a doc with the id in it > > > > curl $CDB/ptest2/_design/vt2/_show/show_details/aacosta > > > > > > > > > > > > two questions > > > > Why is the xml being sent back by default? What is the right param to > pass > > in to trigger the html? > > > > show function is as follows > > > > > > function(doc, req) { > > // !code lib/helpers/template.js > > // !json lib.templates > > > > respondWith(req, { > > html : function() { > > var html = template(lib.templates.show_details, doc); > > return {body:html} > > }, > > xml : function() { > > return { > > body : > > } > > } > > }) > > }; > > Accept header handling in browsers is so bad I'm starting to wish I'd > never written that code. Kinda want to strip it out altogether. > > I believe Rails just stopped supporting the Accept header for the same > reason. (They've moved to URLs like /path/object.xml due to lack of > browser support for Accept.) > > To make a long story short, for the time being you can request: > > $CDB/ptest2/_design/vt2/_show/show_details/aacosta?format=html > > to override the format. > > Chris > > > > > > > html template is as follows > > > > > > > > > > > > Details > > > > > >
> >

<% doc._id %>

> >
> > > > > > > > > > > > Thanks much, > > > > > > > > > > 37% of all statistics are made up on the spot > > > ------------------------------------------------------------------------------------- > > Nitin Borwankar > > nborwankar@gmail.com > > > > > > -- > Chris Anderson > http://jchrisa.net > http://couch.io >