XML builder on Rails

Controller

def sample

@new_posts=Post.find(:first)

respond_to do |format|
format.xml { @postnow }
end

Action

// Create a view file with the extension of xml.builder (for eg.., sample.xml.builder)

xml.instruct!
xml.Response do
xml.Say “Welcome to conference call. Please enter your 5 digit pin follwed by #.”
end

Advertisements