Where do I require docForm from?

33 views
Skip to first unread message

Jofan

unread,
Sep 10, 2010, 8:54:08 AM9/10/10
to CouchApp
Hi,

I'm trying to get Sofa up and running but get a message when I access
the new post page:
"docForm has been moved to vendor/couchapp/lib/docForm.js, use
app.require to load"

I can see that this is sent from jquery.couch.app.js file, and that
app.docForm is used in edit.html.

I've tried requiring it from edit.html, and while that removes the
alert nothing is saved to the database. I've also tried to require it
from other files but no luck so far. Is there someone that has Sofa
running on couchApp 0.7.0, that could guide me to a solution?

Thanks
/Stefan

Jofan

unread,
Sep 13, 2010, 3:02:30 PM9/13/10
to CouchApp
If anybody else run into the same problem I can tell you that I was
able to require it from edit.html by updating docform.js so that it
"exports" the function docForm. See lib/blog in Sofa for an example of
en export.

Cheers
/Stefan

RayLeyva

unread,
Sep 24, 2010, 4:05:40 PM9/24/10
to CouchApp
I place the following at the bottom of my sofa/vendor/couchapp/lib/
docform.js
Just thought I'd ask if this is what you did:

exports.docForm = function(formSelector, opts) {
return docForm(formSelector, opts);
}

This made it work for me after massaging edit.html by:

$("#tagcloud").evently(tagcloud, this);
NEW>>> var docForm = app.require("vendor/couchapp/lib/docform");

...

MODIFIED>>> postForm = docForm.docForm("form#new-post", {

-Ray

On Sep 13, 12:02 pm, Jofan <stefan.li...@gmail.com> wrote:
> If anybody else run into the same problem I can tell you that I was
> able to require it from edit.html by updatingdocform.js so that it
> "exports" the functiondocForm. See lib/blog in Sofa for an example of
> en export.
>
> Cheers
> /Stefan
>
> On Sep 10, 2:54 pm, Jofan <stefan.li...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I'm trying to get Sofa up and running but get a message when I access
> > the new post page:
> > "docFormhas been moved to vendor/couchapp/lib/docForm.js, use
> > app.require to load"
>
> > I can see that this is sent from jquery.couch.app.js file, and that
> > app.docFormis used in edit.html.

qiu

unread,
Sep 25, 2010, 12:19:27 AM9/25/10
to CouchApp
The problem is that although that can remove the alert nothing was
save to database! I tried to fix it with no avail.

Not try to be negative or make other mad but I kinda lost faith in
couchdb. I feel like it is still immature and not ready for production
code.

RayLeyva

unread,
Sep 25, 2010, 10:48:30 AM9/25/10
to CouchApp
I did make further changes to get the edits to save properly.

Basically it's making the app object available in the docform closure.

In docform.js changed all occurrences of:

db. -> opts.app.db.

In edit.html add the app as a var passed to docform:

postForm = docForm.docForm("form#new-post", {
id : {{ docid }},
>>> NEW app : app,

Hope this helps.

I've been trying to clone my version of sofa up to couchone, or
cloudant and having problems with both at the moment or I'd just point
you to that.

-Ray

J Chris Anderson

unread,
Sep 27, 2010, 6:09:35 PM9/27/10
to couc...@googlegroups.com
I just updated Sofa so it no longer uses docForm.

That code was never any good. Sorry I wrote it in the first place. The new edit.html is much better.

Chris


--
You received this message because you are subscribed to the Google Groups "CouchApp" group.
To post to this group, send email to couc...@googlegroups.com.
To unsubscribe from this group, send email to couchapp+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/couchapp?hl=en.




--
Chris Anderson

qiu

unread,
Sep 28, 2010, 10:19:47 AM9/28/10
to CouchApp
Hi where can I get your latest codes ? I just run "couchapp clone
http://jchrisa.net:5984/drl/_design/sofa" again and docform.js is
still there.

Thanks.

Qiulang
> > couchapp+u...@googlegroups.com<couchapp%2Bunsu...@googlegroups.com>
> > .

J Chris Anderson

unread,
Sep 28, 2010, 11:57:10 AM9/28/10
to couc...@googlegroups.com
On Tue, Sep 28, 2010 at 7:19 AM, qiu <qiu...@gmail.com> wrote:
Hi where can I get your latest codes ? I just run "couchapp clone
http://jchrisa.net:5984/drl/_design/sofa" again and docform.js is
still there.



and thanks for the prod. Its on my jchrisa.net server now too
 
To unsubscribe from this group, send email to couchapp+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/couchapp?hl=en.

qiu

unread,
Sep 29, 2010, 11:51:14 AM9/29/10
to CouchApp
I have tested your fix. It works. Thank you Chris!

So maybe you can update the chapter "storing document" of the
definitive guide as well :)
> > <couchapp%2Bunsu...@googlegroups.com<couchapp%252Buns...@googlegroups.com>

Erdem Agaoglu

unread,
Oct 2, 2010, 11:46:06 AM10/2/10
to CouchApp
Does that mean docform is now somewhat deprecated and we shouldn't use
it too?
> > couchapp+u...@googlegroups.com<couchapp%2Bunsubscribe@googlegroups.c om>
> > .

J Chris Anderson

unread,
Oct 2, 2010, 8:25:56 PM10/2/10
to couc...@googlegroups.com
On Sat, Oct 2, 2010 at 8:46 AM, Erdem Agaoglu <erdem....@gmail.com> wrote:
> Does that mean docform is now somewhat deprecated and we shouldn't use
> it too?
>

I heard there is someone working on spiffing it up. I think it could
probably be really useful but I think the problem of managing forms is
too big for CouchApp to tackle.

I'm trying to pare it down to the bare minimum so I can ship it with CouchDB.

Chris

> To unsubscribe from this group, send email to couchapp+u...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages