# Example or Tutorial of Rails & XML

**URL:** <https://www.ruby-forum.com/t/example-or-tutorial-of-rails-xml/182358>\
**Category:** Rails\
**Created:** [January 27, 2010, 12:41am UTC](https://www.ruby-forum.com/t/example-or-tutorial-of-rails-xml/182358 "2010-01-27T00:41:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seirie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Seirie](https://www.ruby-forum.com/u/Seirie)\
**Post date:** [January 27, 2010, 12:41am UTC](https://www.ruby-forum.com/t/example-or-tutorial-of-rails-xml/182358/1 "2010-01-27T00:41:50Z")

</div>

Hey guys. Does anyone know where I can find a good tutorial or example  
on how exactly to work with XML in Rails. Now, I know the different  
technologies you can use (REXML, Builder, etc) and I know how do use  
these to parse through and create documents…where I specifically  
have trouble is where the Rails framework comes into play. I know you  
need to put all the logic in a Model, but I’ve never written a Model  
that wasn’t specifically representing a table from the DB, so I’m just  
not sure where to start. Does that make sense? Any help is appreciated  
guys, thanks!

---

<div class="post-metadata">

**Author:** ![Seirie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Seirie](https://www.ruby-forum.com/u/Seirie)\
**Post date:** [January 27, 2010, 5:31am UTC](https://www.ruby-forum.com/t/example-or-tutorial-of-rails-xml/182358/2 "2010-01-27T05:31:33Z")

</div>

If it helps any, I’m attempting to build an app that utilizes the  
twitter API. I know ppl have built tools for the interfacing with the  
twitter API specifically, but I’d rather deal with it myself using  
classic XML parsing.

---

<div class="post-metadata">

**Author:** ![Seirie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Seirie](https://www.ruby-forum.com/u/Seirie)\
**Post date:** [January 27, 2010, 5:44am UTC](https://www.ruby-forum.com/t/example-or-tutorial-of-rails-xml/182358/3 "2010-01-27T05:44:52Z")

</div>

Hi Seirie,

I’ve been trying to help you find a tutorial that would fit your needs.  
Some of the tutorials are outdated.

I did find a detailed PDF that is dedicated to XML and Rails framework.

[https://www6.software.ibm.com/developerworks/education/x-rubyonrailsxml/x-rubyonrailsxml-a4.pdf](https://www6.software.ibm.com/developerworks/education/x-rubyonrailsxml/x-rubyonrailsxml-a4.pdf)

Let me know if that helps.

---

<div class="post-metadata">

**Author:** ![Seirie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Seirie](https://www.ruby-forum.com/u/Seirie)\
**Post date:** [January 27, 2010, 5:47pm UTC](https://www.ruby-forum.com/t/example-or-tutorial-of-rails-xml/182358/4 "2010-01-27T17:47:57Z")

</div>

Seirie wrote:

> Hey guys. Does anyone know where I can find a good tutorial or example  
> on how exactly to work with XML in Rails. Now, I know the different  
> technologies you can use (REXML, Builder, etc) and I know how do use  
> these to parse through and create documents…where I specifically  
> have trouble is where the Rails framework comes into play. I know you  
> need to put all the logic in a Model, but I’ve never written a Model  
> that wasn’t specifically representing a table from the DB, so I’m just  
> not sure where to start.

Just write a class that has the logic you need. It’s really that  
simple.

> Does that make sense? Any help is appreciated  
> guys, thanks!

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Seirie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Seirie](https://www.ruby-forum.com/u/Seirie)\
**Post date:** [January 27, 2010, 7:25pm UTC](https://www.ruby-forum.com/t/example-or-tutorial-of-rails-xml/182358/5 "2010-01-27T19:25:06Z")

</div>

Excellent, all good advice, thanks guys.

---

<div class="post-metadata">

**Author:** ![Seirie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Seirie](https://www.ruby-forum.com/u/Seirie)\
**Post date:** [January 27, 2010, 4:16pm UTC](https://www.ruby-forum.com/t/example-or-tutorial-of-rails-xml/182358/6 "2010-01-27T16:16:07Z")

</div>

Seirie wrote:

> If it helps any, I’m attempting to build an app that utilizes the  
> twitter API. I know ppl have built tools for the interfacing with the  
> twitter API specifically, but I’d rather deal with it myself using  
> classic XML parsing.

Don’t reinvent the wheel. Use a Twitter library. I _highly_ recommend  
TwitterAuth.

Even if you want to ignore that advice, XML is the wrong tool. Twitter  
makes its data available as JSON, which is much nicer to work with than  
XML.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
