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

Changeset 2777

Show
Ignore:
Timestamp:
10/28/05 07:33:54 (3 years ago)
Author:
david
Message:

Fix that render :text didn't interpolate instance variables (Closes #2629, #2626) [skaes]

Files:

Legend:

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

    r2773 r2777  
    11*SVN* 
     2 
     3* Fix that render :text didn't interpolate instance variables #2629, #2626 [skaes] 
    24 
    35* Fix line number detection and escape RAILS_ROOT in backtrace Regexp [Nicholas Seckar] 
  • trunk/actionpack/lib/action_controller/layout.rb

    r2749 r2777  
    220220 
    221221        erase_render_results 
     222        add_variables_to_assigns 
    222223        @template.instance_variable_set("@content_for_layout", content_for_layout) 
    223224        render_text(@template.render_file(layout, true), deprecated_status) 
  • trunk/actionpack/test/controller/new_render_test.rb

    r2522 r2777  
    3434  def render_text_hello_world 
    3535    render :text => "hello world" 
     36  end 
     37  
     38  def render_text_hello_world_with_layout 
     39    @variable_for_layout = ", I'm here!" 
     40    render :text => "hello world", :layout => true 
    3641  end 
    3742 
     
    170175        when "hello_world", "layout_test", "rendering_without_layout", 
    171176             "rendering_nothing_on_layout", "render_text_hello_world", 
     177             "render_text_hello_world_with_layout", 
    172178             "partial_only", "partial_only_with_layout", 
    173179             "accessing_params_in_template", 
     
    227233  end 
    228234 
     235  def test_do_with_render_text_and_layout 
     236    get :render_text_hello_world_with_layout 
     237    assert_equal "<html>hello world, I'm here!</html>", @response.body 
     238  end 
     239 
    229240  def test_do_with_render_custom_code 
    230241    get :render_custom_code 
  • trunk/actionpack/test/fixtures/layouts/standard.rhtml

    r4 r2777  
    1 <html><%= @content_for_layout %></html> 
     1<html><%= @content_for_layout %><%= @variable_for_layout %></html>