Render XML in Rails 3

I’m trying to render XML to the client in my Rails 3 application.
There’s a section called Rendering XML in this documentation:

http://apidock.com/rails/ActionController/Base/render

I’m trying to follow the example like so:

render :xml => {:name => “David”}

But that produces the following:

<?xml version="1.0" encoding="UTF-8"?> David

Such a response would be invalid for the API I’m trying to use due to
the presence of the tags. How do I only render the following:

David

Ultimately, I’m trying to render something like this:

David

Also, in the API I’m trying to use, the tags are case sensitive
(meaning I must output Person and not person). Thanks for any help!

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