Rails HTTP Streaming: ActionView :: Template :: Error (undefined `encoding 'method for # <ActionView :: StreamingBuffer>)

I am trying to enable streaming HTTP streams in my Rails application, but I have 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 a method content_for(or provide).

My situation: I have a controller with an action using render stream: true, this action displays a template normalthat invokes the template application.

I tried with many different servers (WEBrick, Puma, Unicorn, ...), but the problem is the same.

My template template slim.

+4
source share

Source: https://habr.com/ru/post/1531386/


All Articles