You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jester JS
I have receently encountered a problem involving nested classes using
Jester. The situation is as follows:
I have two ActiveRecord classes, category and subcategory with
category having many subcategories.
I have the following in my Category controller
opt = {:include => :subcategories }
format.json { render :text => @category.to_json(opt)
My javascript client code is:
var xx = Category.find(42)
Now what happens is that all the data returns to the client but
category.subcategories is populated with an array of Objects (contains
the correct data) when I would have expected it to be populated with
an array of Subcategory. This has subsequent problems in calling
save() ext on subcategory. I am able to correctly populate
subcategories with further calls to subcategory.find() but this
requires additional calls which I would prefer not to do.
The json (and xml when I tried that) appears to be well formed and the
use of a global Category({checkNow: true}) does not assist in
identifying the contents of category.subcategories.
Is this:
1.An error on my part
2. A limitation of Jester
3. A bug in Jester
Any clarification and assistance would be much appreciated.
Eric Mill
unread,
Feb 22, 2008, 3:24:42 PM2/22/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jester JS
Thanks jfw, I added this as an issue to the tracker.