To_xml with deep associations

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

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.

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs