Force Content-Type 'text/xml'


#1

This is driving me crazy. How do I force Content-Type to “text/xml”? It
doesn’t matter what I’ve tried, I still get “application/xml”.

I’ve tried:

headers[“Content-Type”] = “text/xml”
response.headers[“Content-Type”] = “text/xml”

I’m rendering a builder file through:

render :template => “controller/file” # file is of course file.builder

I’ve even jumped down into Rails and gotten rid of every instance of
“application/xml” I could find (incidentally, only in mime_types.rb),
and it
STILL gives me that type.

What am I missing?

Jason


#2

I’ve had luck with the following:

render :text => xml_variable_here, :content_type => “text/xml”

I’ve never tried it with render :template though.

HTH

  • josh