streaming doesn't work when XML/CSV is rendered in template #3063

sradu opened this Issue Sep 18, 2011 · 6 comments


None yet

4 participants

sradu commented Sep 18, 2011

I have a controller action like:

def export
@store = Store.find_by_unique_code(params[:unique_code])
unless @store
render :nothing => true

respond_to do |format|
  format.xml { render :stream => true }
  format.csv { render :stream => true }


In export.xml.erb

<% @store.products.each do |p| -%>
<%= render_store_products_xml(p).html_safe -%>
<% end %>

:stream => true doesn't seem to do anything, Rails doesn't answer at all. The docs say that render :json and render :xml doesn't work, but templating does.

rmehner commented Oct 27, 2011

Having the same issue here.


def show
  @product = Product.find(params[:id])
  render stream: true

Nothing more than that. When I have the same view but as HTML streaming works like expected.

View (show.csv.erb):

<% @product.categories.each do |category| %>
  <%= %>
<% end %>
upstream commented Nov 7, 2011
  • 1 Same problem here.
jeremyf commented Apr 29, 2012

@sradu Is this still an issue?


sradu commented Apr 29, 2012

I went with another solution, using a simple sinatra app just for this. The issue can be closed from my point of view.


jeremyf commented Apr 29, 2012

@sradu Can you go ahead and close the issue?

sradu commented Apr 29, 2012


@sradu sradu closed this Apr 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment