Hi,
In the controller, I have an variable @xml_string = "<tag> hello \n world </tag>"
. Now I want to show the content of @xml_string
. In erb file I wrote <%= @xml_string %>
, but this can only display hello world
, the xml tag <tag> </tag>
was missed and \n
was ignored.
Aslo , <% render :text => @xml_string , :content_type = 'application/xml' %>
would not show any thing at all.
what is the correct way to achieve this? Thanks.