Hi All. I am trying to get to_xml to output an xml structure with deep associations. I am currently using find with :include => [{:section => :component}, :client] which successfully retrieves all the records however the to_xml function doesn''t allow that. Has anyone managed to do this? Thanks RJ -- 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-/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 -~----------~----~----~----~------~----~------~--~---
RJ wrote:> I am trying to get to_xml to output an xml structure with deep > associations. > > I am currently using find with :include => [{:section => :component}, > :client] which successfully retrieves all the records however the to_xml > function doesn''t allow that.The stock to_xml function doesn''t allow that. You''ll have to write your own XML output function in order to support this. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Eden Li wrote:> RJ wrote: >> I am trying to get to_xml to output an xml structure with deep >> associations. >> >> I am currently using find with :include => [{:section => :component}, >> :client] which successfully retrieves all the records however the to_xml >> function doesn''t allow that. > > The stock to_xml function doesn''t allow that. You''ll have to write > your own XML output function in order to support this.I did a search of the forum and it appears that edge rails has been patched so that to_xml should support more than one level. I am running on edge but has as yet been unable to get it working. http://www.ruby-forum.com/topic/69936#123028 I contacted the patch creator so will see what comes of that. -- 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-/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 -~----------~----~----~----~------~----~------~--~---