Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 54365 invoked from network); 24 Jul 2009 22:46:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Jul 2009 22:46:31 -0000 Received: (qmail 64044 invoked by uid 500); 24 Jul 2009 22:47:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 63976 invoked by uid 500); 24 Jul 2009 22:47:35 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 63966 invoked by uid 99); 24 Jul 2009 22:47:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jul 2009 22:47:35 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nborwankar@gmail.com designates 209.85.210.204 as permitted sender) Received: from [209.85.210.204] (HELO mail-yx0-f204.google.com) (209.85.210.204) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jul 2009 22:47:23 +0000 Received: by yxe42 with SMTP id 42so3502593yxe.13 for ; Fri, 24 Jul 2009 15:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=AlAiGmP0v1zoJTP08CYOwEv0wiJ3Jn58lPb2/PzbNvs=; b=WS3H+Mx0Gzr/TCUxYpGArAlyybt46YYq9H+J+HfZCRbeQ3yB8j0K/pr/IqF4yE4VCK kIrZqieROxBefXuu9WhwevAstDrmGnaqYk+oY0PinQlHwW9Ywg93lE3WI7qoMruWezSW XQUcI0Qq3BGhcwGu/kARcTLcOTV88tzzIh7BE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=a50zt9EGjQtZ2Uq+j7tG7mYBgk4DWg60mWEUATajWuT+sLhqAwTOjy6XjJR5wtd62/ DgkD2IM+MkuddhBWVr32hnXKzsN5iv6YbEOcR8yyso241La5S5ogQ8A123DVSMVubdrQ AhANht4MX1IOiXDuCZXiZabM+QOV3xZD1H0vE= MIME-Version: 1.0 Sender: nborwankar@gmail.com Received: by 10.231.38.134 with SMTP id b6mr1366352ibe.37.1248475622300; Fri, 24 Jul 2009 15:47:02 -0700 (PDT) In-Reply-To: References: <921000907241219p6c78d5a8pee915294ed0af06d@mail.gmail.com> <921000907241506j35ec42ddh8e964b309eca22a0@mail.gmail.com> Date: Fri, 24 Jul 2009 15:47:02 -0700 X-Google-Sender-Auth: 6c4197ca2bfd51f4 Message-ID: <921000907241547o16e4349fr95943aa00ebff568@mail.gmail.com> Subject: Re: switching between response content type in show? how to trigger html response inst of default xml From: Nitin Borwankar To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0003255750f6fa5e3e046f7b61eb X-Virus-Checked: Checked by ClamAV on apache.org --0003255750f6fa5e3e046f7b61eb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Paul, No change - still the same error. curl $CDB/ptest2/_design/vt2/_show/show_details/aacosta?format=html {"error":"noproc","reason":"{gen_server,call,\n [couch_query_servers,{ret_proc,<<\"javascript\">>,<0.19458.0>}]}"} Has anyone gotten list views to work on 0.9 ? I can't be the only one having this problem right? Or are most people not using couchapp ? Nitin 37% of all statistics are made up on the spot ------------------------------------------------------------------------------------- Nitin Borwankar nborwankar@gmail.com On Fri, Jul 24, 2009 at 3:28 PM, Paul Davis wrote: > Another shot in the dark, care to try quoting the html value so that > it's {"html": ...} > > On Fri, Jul 24, 2009 at 6:06 PM, Nitin Borwankar > wrote: > > 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 > >> > > > --0003255750f6fa5e3e046f7b61eb--