Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > transmitting raw data vs. tree-structured data

Reply
Thread Tools

transmitting raw data vs. tree-structured data

 
 
Max You
Guest
Posts: n/a
 
      06-16-2010
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/.

 
Reply With Quote
 
 
 
 
Brian Candler
Guest
Posts: n/a
 
      06-16-2010
Max You wrote:
> Anyone has any ideas?


Use JSON.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Max You
Guest
Posts: n/a
 
      06-19-2010
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/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Http error 404 on transmitting big data hhp ASP .Net Web Services 3 05-26-2008 06:27 PM
transmitting XML files vs. binary data Aleksej C++ 5 09-10-2006 09:39 AM
Transmitting strings via tcp from a windows c++ client to a Java server qqq111 Java 19 03-01-2006 05:36 AM
transmitting eventHandler pb Franck ASP .Net 3 09-07-2005 01:56 PM
Wireless router not transmitting Chris Computer Support 9 06-28-2005 09:51 PM



Advertisments