Hi Camille,

On Sat, 2010-02-20 at 17:15 +0100, Camille Roux wrote:
> Hello,
> 
> I'm working on a Rails app which has a REST API. I manage two formats
> JSON and XML.
> Very often to simplify the use if the API, I'm making includes. But when
> you add params to to_json and to_xml like :only, :except, it's not only
> applied on the root object but on all the objects included.

I use Builder when the to_xml method is not flexible enough.

http://api.rubyonrails.org/classes/Builder/XmlMarkup.html

For json, there is no current equivalent AFAIK, but googling 'rails
builder json' gave some trails to follow.

HTH,
Bill

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to