Custom template handler

Can someone please explain to me how I can access the main response object and headers in a template handler? I want to create a csv builder that streams row by row through a template instead of having to keep the whole code in the controller, but I can't even get a basic version working

Sample code here: Rails Custom ActionView::Template::Handler no data sent - Stack Overflow

Network error? Where is that csv file your trying to load?

yeah chrome shows “Network Error” for the file, with no response body in the network tools. there are no errors on the rails side of things. what do you mean “where is the csv file”? its generated. that’s the whole issue here

I figured out it was a “deflate” header that was being sent without the compression actually being used, and ended up building a gem that adds a responder to handle streaming instead of pre-rendering

Great, I thought you were trying to load a file.