huard.elise-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Aug-01 12:04 UTC
to_xml and to_json behaviour with nil values
Hi, i was wondering if there is any way to just skip attributes having nil values when to_xml or to_json on ActiveRecord. The default behavior is to include a nil value: xml: <identity-url nil="true"/> json: "identity_url": null Is there an option way to make this value just not appear ? Or should it be a hack in the serialization itself ? Thank you, Elise --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---