Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5544

Show
Ignore:
Timestamp:
11/17/06 13:10:23 (2 years ago)
Author:
bitsweat
Message:

ActionView::Base.erb_variable accessor names the buffer variable used to render templates. Defaults to _erbout; use _buf for erubis.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r5536 r5544  
    11*SVN* 
    22 
    3 * Deprecate standalone components.  [Jeremy Kemper
     3* ActionView::Base.erb_variable accessor names the buffer variable used to render templates. Defaults to _erbout; use _buf for erubis.  [Rick Olson
    44 
    55* assert_select_rjs :remove.  [Dylan Egan] 
  • trunk/actionpack/lib/action_controller/caching.rb

    r5412 r5544  
    331331        unless perform_caching then block.call; return end 
    332332 
    333         buffer = eval("_erbout", block.binding) 
     333        buffer = eval(ActionView::Base.erb_variable, block.binding) 
    334334 
    335335        if cache = read_fragment(name, options) 
  • trunk/actionpack/lib/action_view/base.rb

    r5411 r5544  
    184184    @@debug_rjs = false 
    185185    cattr_accessor :debug_rjs 
     186     
     187    @@erb_variable = '_erbout' 
     188    cattr_accessor :erb_variable 
    186189 
    187190    @@template_handlers = HashWithIndifferentAccess.new 
  • trunk/actionpack/lib/action_view/helpers/capture_helper.rb

    r5335 r5544  
    5757        # execute the block 
    5858        begin 
    59           buffer = eval("_erbout", block.binding) 
     59          buffer = eval(ActionView::Base.erb_variable, block.binding) 
    6060        rescue 
    6161          buffer = nil 
     
    6363         
    6464        if buffer.nil? 
    65           capture_block(*args, &block) 
     65          capture_block(*args, &block).to_s 
    6666        else 
    67           capture_erb_with_buffer(buffer, *args, &block) 
     67          capture_erb_with_buffer(buffer, *args, &block).to_s 
    6868        end 
    6969      end 
     
    100100       
    101101        def capture_erb(*args, &block) 
    102           buffer = eval("_erbout", block.binding) 
     102          buffer = eval(ActionView::Base.erb_variable, block.binding) 
    103103          capture_erb_with_buffer(buffer, *args, &block) 
    104104        end 
  • trunk/actionpack/lib/action_view/helpers/text_helper.rb

    r5431 r5544  
    2424      #   <%= "hello" %> 
    2525      def concat(string, binding) 
    26         eval("_erbout", binding).concat(string) 
     26        eval(ActionView::Base.erb_variable, binding) << string 
    2727      end 
    2828