diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-01-16 17:35:01 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-01-16 17:35:01 -0800 |
commit | ec5c946138f63dc975341d6521587adc74f6b441 (patch) | |
tree | 68f27e85831258be9caf238fe14701c2e731b0e2 | |
parent | c740ebdaf580c8c9772a9099c7a9c11ef3105f3a (diff) | |
download | rails-ec5c946138f63dc975341d6521587adc74f6b441.tar.gz rails-ec5c946138f63dc975341d6521587adc74f6b441.tar.bz2 rails-ec5c946138f63dc975341d6521587adc74f6b441.zip |
Pull buffer assignment up
Since everything goes through a `run` method, we can pull the buffer
assignment up.
-rw-r--r-- | actionview/lib/action_view/base.rb | 1 | ||||
-rw-r--r-- | actionview/lib/action_view/template/handlers/erb/erubi.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb index 4318791760..d86dd0b6c4 100644 --- a/actionview/lib/action_view/base.rb +++ b/actionview/lib/action_view/base.rb @@ -212,6 +212,7 @@ module ActionView #:nodoc: 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 diff --git a/actionview/lib/action_view/template/handlers/erb/erubi.rb b/actionview/lib/action_view/template/handlers/erb/erubi.rb index d0e87e6e7f..e155bae89d 100644 --- a/actionview/lib/action_view/template/handlers/erb/erubi.rb +++ b/actionview/lib/action_view/template/handlers/erb/erubi.rb @@ -13,7 +13,7 @@ module ActionView # 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] = "" |