# Xml and habtm associations

**URL:** <https://www.ruby-forum.com/t/xml-and-habtm-associations/144039>\
**Category:** Rails\
**Created:** [July 24, 2008, 9:18pm UTC](https://www.ruby-forum.com/t/xml-and-habtm-associations/144039 "2008-07-24T21:18:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Raganhan\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Fernando\_Raganhan\_B](https://www.ruby-forum.com/u/Fernando_Raganhan_B)\
**Post date:** [July 24, 2008, 9:18pm UTC](https://www.ruby-forum.com/t/xml-and-habtm-associations/144039/1 "2008-07-24T21:18:14Z")

</div>

Hi, I am building an app in rails and i’m having some trouble in passing  
a  
model object to xml.  
The model name is event and it habtm videos, I’d like to pass the event  
information (name, date, description) as well the videos(link, title,  
duration) information to xml.  
With the code below i was able to pass only the event information to  
xml,  
but not the videos.  
def show  
@event = Event.find\_by\_id(params[:id])  
respond\_to do |format|  
format.html # show.html.erb  
format.xml { render :xml =\> @event }  
end  
end

I was hoping to avoid writing rxml files… but if it is not possible  
someone can plz pass me a tutorial about it

Thx in advance

–

Fernando Raganhan Barbosa

“He knows changes aren’t permanent,  
But change is.” - Tom Sawyer Rush
