Forum: Ruby on Rails Getting xml file display as xml when using render :text

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C95664a5c59ccdfb0da2f5910675c62c?d=identicon&s=25 Sudhi Kulkarni (sudhi)
on 2009-03-05 10:44
Hi,

I have a problem when I do a

fd = File.open("test","rb")
render :text fd.read

I the "test" file contains xml

<animal>dog</animal>
<animal>cat</animal>

The output is shown as "dog cat" how do I get the xml shown as is with
the animal tag also shown?

THanks,
Sudhi
This topic is locked and can not be replied to.