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"?> <hash> <name>David</name> </hash>
Such a response would be invalid for the API I'm trying to use due to the presence of the <hash> tags. How do I only render the following:
<name>David</name>
Ultimately, I'm trying to render something like this:
<Person><Name>David</Name></Person>
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!