Skip to content

Commit

Permalink
Pull buffer assignment up
Browse files Browse the repository at this point in the history
Since everything goes through a `run` method, we can pull the buffer
assignment up.
  • Loading branch information
tenderlove committed Jan 17, 2019
1 parent c740ebd commit ec5c946
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions actionview/lib/action_view/base.rb
Expand Up @@ -212,6 +212,7 @@ def initialize(context = nil, assigns = {}, controller = nil, formats = nil) #:n

def run(method, locals, buffer, &block)
_old_output_buffer = @output_buffer
@output_buffer = buffer
send(method, locals, buffer, &block)
ensure
@output_buffer = _old_output_buffer
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/template/handlers/erb/erubi.rb
Expand Up @@ -13,7 +13,7 @@ def initialize(input, properties = {})

# Dup properties so that we don't modify argument
properties = Hash[properties]
properties[:preamble] = "@output_buffer = output_buffer;"
properties[:preamble] = ""
properties[:postamble] = "@output_buffer.to_s"
properties[:bufvar] = "@output_buffer"
properties[:escapefunc] = ""
Expand Down

0 comments on commit ec5c946

Please sign in to comment.