4

I try enabling HTTP streaming in my Rails app but I keep having this error:

ActionView::Template::Error (undefined method `encoding' for #<ActionView::StreamingBuffer:0x007ffad89dae38>):
    1: = content_for :content do
    2:   h1 Hello
    3: 
    4: = render template: 'layouts/application'

And it seems to work fine without the content_for (or provide method).

My situation is: I have a controller with an action using render stream: true, this action renders the normal template that will call the application template.

I tried with a lot of different servers (WEBrick, Puma, Unicorn, ...) but the issue is the same.

My templating format is slim.

Gumbo
  • 643,351
  • 109
  • 780
  • 844
Dorian
  • 22,759
  • 8
  • 120
  • 116

0 Answers0