Ruby, Rails, Render, and the Content-Type HTTP header
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.