![]() |
transmitting raw data vs. tree-structured data
Hi, I'm trying to decide using one of two approaches getting
tree-structured data to users. approach #1: build the tree from raw data in rails model code, then transfer it via AJAX in XML approach #2: transfer all raw data in XML form first, then use javascript to build the tree. The problem with approach #1 is that I'm currently stuck doing it. Building the tree in model code is easy; but I'm having all sort of problems transferring it. (I can't use hash.to_xml directly since each key is an object, and using object.to_xml while building to tree results in incorrect rendering) The problem with approach #2 is I don't know if javascript is power enough to handle "building a tree from xml, preferably using a hash that can have associative arrays as keys", which is why I want to ask around and post on this forum. I'm new to both Rails and javascript. Anyone has any ideas? -- Posted via http://www.ruby-forum.com/. |
Re: transmitting raw data vs. tree-structured data
|
Re: transmitting raw data vs. tree-structured data
Thank you both for the replies. I ended up mandating all AJAX data
transfer to use JSON format, and it works very well. Additionally, it turned out very easy to rewrite the stuff and add custom to_json methods in rails. -- Posted via http://www.ruby-forum.com/. |
| All times are GMT. The time now is 08:29 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.