Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created June 4, 2009 22:41
Show Gist options
  • Save sprite2005/123906 to your computer and use it in GitHub Desktop.
Save sprite2005/123906 to your computer and use it in GitHub Desktop.
class ChatController < ApplicationController
def authorize
xml = Builder::XmlMarkup.new(:indent => 2)
xml.instruct!
xml.auth do
xml.userName
xml.gender
xml.level
xml.photo
xml.photoModeImage
end
render :text => xml
end
end
Result:
<?xml version="1.0" encoding="UTF-8"?>
<auth>
<userName/>
<gender/>
<level/>
<photo/>
<photoModeImage/>
</auth>
<to_s/>
How to I get rid of the <to_s/>?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment