Katipo
Search  
Site Blog
  About  
  Home
About Portfolio Solutions Client Area Contact Us
: : About Us
Awards
Jobs
Our People
What Is A ... ?
Working From Home
News
Photo Gallery
Katipo Blog


Archive for December, 2006

Stupid Human Tricks with Ruby on Rails’ RXML, aka XML Builder

Tuesday, December 5th, 2006

Man, I miss the old “Late Night with David Letterman” of the 80’s sometimes…

Alright, to the point. Ruby on Rails makes it extremely easy to generate nicely formed XML from your application, especially if you are simple doing something like the following:

 def show
    @topic = Topic.find(params[:id])
    respond_to do |format|
      format.html
      format.xml { render :x ml => @topic.to_xml }
    end
  end

If the request is for XML version of the topic, this will take all the attributes of a topic and make them into well formed XML. Nifty, but this doesn’t provide fine-grained control of the XML output which is what I need. RXML templates to the rescue:

(more…)


Katipo
Rachel Snowboarding