O'Reilly logo

Flex on Rails: Building Rich Internet Applications with Adobe Flex 3 and Rails 2 by Daniel Wanja, Tony Hillerson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

17 Hierarchical Data with RubyAMF

Goal

You want to get some structured, hierarchical data from Rails to Flex using RubyAMF.

Solution

Use a nested set Rails plug-in, such as awesome_nested_set (http://github.com/collectiveidea/awesome_nested_set), and RubyAMF’s method class mapping option to return an object graph to Flex with one call.

Nested Sets

Rails has a few options for storing hierarchical data, and one of them is called “Awesome Nested Set,” which is, you must admit, an awesome name. A Nested Set is a way to store data that maps into a hierarchical, tree-like structure in a database table, which does not natively support hierarchical relationships.

Basically, the idea is to store information about sets that contain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required