Ruby on Rails/ActionView/Builder

XmlBuilder is a class which supports creating XML output with Ruby methods. Most method calls sent to the XmlBuilder class will be rendered directly. You also have access to all instance variables defined in the action. For example:

In /app/controllers/demo_controller.rb:

class DemoController < ApplicationController def index @title = 'History' end end

In /app/views/demo/index.rxml:

xm.instruct! #  xm.html {                     # xm.head {                   # xm.title(@title)       #     History }                           #       xm.body {                    # xm.comment! "HI"          # xm.h1("Header")           #     Header xm.p("paragraph")         #     paragraph }                           #     }                              #