# Has\_and\_belongs\_to\_many into XML transformation

**URL:** <https://www.ruby-forum.com/t/has-and-belongs-to-many-into-xml-transformation/112700>\
**Category:** Rails\
**Created:** [August 22, 2007, 9:58am UTC](https://www.ruby-forum.com/t/has-and-belongs-to-many-into-xml-transformation/112700 "2007-08-22T09:58:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunshine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@Sunshine](https://www.ruby-forum.com/u/Sunshine)\
**Post date:** [August 22, 2007, 9:58am UTC](https://www.ruby-forum.com/t/has-and-belongs-to-many-into-xml-transformation/112700/1 "2007-08-22T09:58:17Z")

</div>

I have two models: articles and categories with  
has\_and\_belongs\_to\_many(habtm) relation between them. Now I need to  
return answer on the GET request to the url like /article/1.xml. I  
need to return the information about article + information about all  
categories linked with this article. I have used to\_xml method before  
but it seems like there no habtm support in it. Does anybody knows how  
to make this correctly?
