It just happened to me with a simple problem: change the Content-Type HTTP Response Header for using standard Rails templates to be
text/xml.The solution is pretty straight-forward:
response.headers["Content-Type"] = 'text/xml'...as I eventually found here.Setting this hash value in your ActionController action method does the trick.
Here's hoping google picks this up and saves someone 20 minutes.
4 comments:
You could also give www.stackoverflow.com a try. If the question isn't already there, ask it, and you'll often get it answered within a few minutes.
Also, Twittering often leads to rapid answers.
You could also use
render :text => "test", :content_type => 'text/plain'
Also of note: this is helpful for setting attachment disposition if you're streaming data with render :text => Proc.new { *blah blah* }
That way, you can stream a big piece of generated downloadable data, instead of using send_data and having to put the entire thing in memory at once first
Post a Comment