Hi, I''m designing a new API for my project, and I want to return objects that have nested children as json. For that purpose i''ve decided to use RABL. I want the client side to be able to understand whether the object is valid, and if not which fields are missing in order to save it correctly. The design I thought of should include some fields as optional, under an optional hash, and the rest are required. The required fields should appear right under the root of the json. So the output I try to describe should look something like this: { "name": "John", "last_name": "Doe", "optional": { "address": "Beverly Hills 90210", "phones":[{"number":"123456","name":"work"}, {"number":"654321","name":"mobile"}] } } The above output example describes the required fields name and last name, and the not required address and phones (which is associated in a belongs_to-has_many relationship to the object). name, last_name and address are User''s DB fields. Playing with RABL I didn''t manage so far to create this kind of structure. Any suggestions? I''m looking for a DRY way to implement this for all my models. Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.