I have question regarding render :text ... I read the conten of XML file
and display it using render :text ... but the content only is shown and
not the entire xml file ... How do I get the xml file display as xml
file in the output?
to state with an example the problem I have if the xml is
<animal>dog</animal> and I use render :text then output is only dog... I
want to output entire <animal>dog</animal>
are you sure that this is real output? Try using wget or curl to see
what real output is. Or maybe look into page source? (Ctrl + V on
firefox). It might be that your browser is not displaying xml tags
just ignoring them, and displays only what's inside.
It‘s not necessary to callto_xml on the object you want to render, since [render](http://api.rubyonrails.org/classes/ActionController/Base.html#M000633) will automatically do that for
you:
# Also renders '<name>David</name>'
render :xml => {:name => "David"}