Example or Tutorial of Rails & XML

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!

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.

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

Let me know if that helps.

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
[email protected]

Excellent, all good advice, thanks guys.

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
[email protected]

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