I'm not actually sure that helps, since we're not sending a blob of content already known in the controller. The rendering is done via the normal view erb magic, but with a .yml.erb instead of a .html.erb. It actually worked fine with no controller modifications at all, except the content displayed in the browser rather than triggering a download -- all the above deos is sets the Content-Disposition header and then renders normally.