<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -178,10 +178,7 @@ module ActionView #:nodoc:
     # that alert()s the caught exception (and then re-raises it). 
     @@debug_rjs = false
     cattr_accessor :debug_rjs
-    
-    @@erb_variable = '_erbout'
-    cattr_accessor :erb_variable
-    
+
     attr_internal :request
 
     delegate :request_forgery_protection_token, :template, :params, :session, :cookies, :response, :headers,</diff>
      <filename>actionpack/lib/action_view/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,20 +31,13 @@ module ActionView
       #   &lt;/body&gt;&lt;/html&gt;
       #
       def capture(*args, &amp;block)
-        # execute the block
-        begin
-          buffer = eval(ActionView::Base.erb_variable, block.binding)
-        rescue
-          buffer = nil
-        end
-        
-        if buffer.nil?
-          capture_block(*args, &amp;block).to_s
-        else
-          capture_erb_with_buffer(buffer, *args, &amp;block).to_s
-        end
+        @output_buffer, old_buffer = '', @output_buffer
+        yield *args
+        @output_buffer
+      ensure
+        @output_buffer = old_buffer
       end
-      
+
       # Calling content_for stores a block of markup in an identifier for later use.
       # You can make subsequent calls to the stored content in other templates or the layout
       # by passing the identifier as an argument to &lt;tt&gt;yield&lt;/tt&gt;.
@@ -121,40 +114,19 @@ module ActionView
       # named &lt;tt&gt;@content_for_#{name_of_the_content_block}&lt;/tt&gt;. The preferred usage is now
       # &lt;tt&gt;&lt;%= yield :footer %&gt;&lt;/tt&gt;.
       def content_for(name, content = nil, &amp;block)
-        existing_content_for = instance_variable_get(&quot;@content_for_#{name}&quot;).to_s
-        new_content_for      = existing_content_for + (block_given? ? capture(&amp;block) : content)
-        instance_variable_set(&quot;@content_for_#{name}&quot;, new_content_for)
+        ivar = &quot;@content_for_#{name}&quot;
+        instance_variable_set(&quot;@content_for_#{name}&quot;, &quot;#{instance_variable_get(ivar)}#{block_given? ? capture(&amp;block) : content}&quot;)
       end
 
       private
-        def capture_block(*args, &amp;block)
-          block.call(*args)
-        end
-      
-        def capture_erb(*args, &amp;block)
-          buffer = eval(ActionView::Base.erb_variable, block.binding)
-          capture_erb_with_buffer(buffer, *args, &amp;block)
-        end
-      
-        def capture_erb_with_buffer(buffer, *args, &amp;block)
-          pos = buffer.length
-          block.call(*args)
-        
-          # extract the block 
-          data = buffer[pos..-1]
-        
-          # replace it in the original with empty string
-          buffer[pos..-1] = ''
-        
-          data
-        end
-      
         def erb_content_for(name, &amp;block)
-          eval &quot;@content_for_#{name} = (@content_for_#{name} || '') + capture_erb(&amp;block)&quot;
+          ivar = &quot;@content_for_#{name}&quot;
+          instance_variable_set(ivar, &quot;#{instance_variable_get(ivar)}#{capture(&amp;block)}&quot;)
         end
-      
-        def block_content_for(name, &amp;block)
-          eval &quot;@content_for_#{name} = (@content_for_#{name} || '') + capture_block(&amp;block)&quot;
+
+        def block_content_for(name)
+          ivar = &quot;@content_for_#{name}&quot;
+          instance_variable_set(ivar, &quot;#{instance_variable_get(ivar)}#{yield}&quot;)
         end
     end
   end</diff>
      <filename>actionpack/lib/action_view/helpers/capture_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -208,7 +208,7 @@ module ActionView
 
     private
       def block_is_within_action_view?(block)
-        eval(&quot;defined? _erbout&quot;, block.binding)
+        !@output_buffer.nil?
       end
     end
     </diff>
      <filename>actionpack/lib/action_view/helpers/javascript_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -126,7 +126,7 @@ module ActionView
         end
 
         def block_is_within_action_view?(block)
-          eval(&quot;defined? _erbout&quot;, block.binding)
+          !@output_buffer.nil?
         end
     end
   end</diff>
      <filename>actionpack/lib/action_view/helpers/tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,8 +25,12 @@ module ActionView
       #       end
       #       # will either display &quot;Logged in!&quot; or a login link
       #   %&gt;
-      def concat(string, binding)
-        eval(ActionView::Base.erb_variable, binding) &lt;&lt; string
+      def concat(string, binding = nil)
+        if @output_buffer
+          @output_buffer &lt;&lt; string
+        else
+          string
+        end
       end
 
       if RUBY_VERSION &lt; '1.9'</diff>
      <filename>actionpack/lib/action_view/helpers/text_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -43,13 +43,11 @@ module ActionView
       include Compilable
 
       def compile(template)
-        ::ERB.new(template.source, nil, @view.erb_trim_mode).src
+        ::ERB.new(template.source, nil, @view.erb_trim_mode, '@output_buffer').src
       end
 
       def cache_fragment(block, name = {}, options = nil) #:nodoc:
-        @view.fragment_for(block, name, options) do
-          eval(ActionView::Base.erb_variable, block.binding)
-        end
+        @view.fragment_for(block, name, options) { @view.output_buffer }
       end
     end
   end</diff>
      <filename>actionpack/lib/action_view/template_handlers/erb.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>da91450e687fe9faa7b0575062c2b2aacc261f68</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <login>jeremy</login>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/rails/rails/commit/933697a5fc5f4c56c4fd7fbbd31b8973df9c1054</url>
  <id>933697a5fc5f4c56c4fd7fbbd31b8973df9c1054</id>
  <committed-date>2008-06-02T21:32:50-07:00</committed-date>
  <authored-date>2008-06-02T09:12:00-07:00</authored-date>
  <message>Try replacing _erbout with @output_buffer</message>
  <tree>44f55a5c801e94db8c3637c73dfc6db7f2c3350d</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <login>jeremy</login>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
