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

Changeset 1970

Show
Ignore:
Timestamp:
08/05/05 20:51:03 (3 years ago)
Author:
minam
Message:

Make sure :layout => false is always used when rendering inside a layout

Files:

Legend:

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

    r1963 r1970  
    11*SVN* 
     2 
     3* Make sure :layout => false is always used when rendering inside a layout 
    24 
    35* Use raise instead of assert_not_nil in Test::Unit::TestCase#process to ensure that the test variables (controller, request, response) have been set 
  • trunk/actionpack/lib/action_controller/layout.rb

    r1915 r1970  
    209209 
    210210      if apply_layout?(template_with_options, options) && (layout = pick_layout(template_with_options, options, deprecated_layout)) 
     211        options = options.merge :layout => false if template_with_options 
    211212        logger.info("Rendering #{options} within #{layout}") if logger 
    212213 
  • trunk/actionpack/test/controller/new_render_test.rb

    r1961 r1970  
    5959  def rendering_without_layout 
    6060    render :action => "hello_world", :layout => false 
     61  end 
     62 
     63  def layout_overriding_layout 
     64    render :action => "hello_world", :layout => "standard" 
    6165  end 
    6266   
     
    155159        when "builder_layout_test" 
    156160          "layouts/builder" 
    157         when "action_talk_to_layout" 
     161        when "action_talk_to_layout", "layout_overriding_layout" 
    158162          "layouts/talk_from_action" 
    159163      end 
     
    262266  end 
    263267 
     268  def test_layout_overriding_layout 
     269    get :layout_overriding_layout 
     270    assert_no_match %r{<title>}, @response.body 
     271  end 
     272 
    264273  def test_rendering_nothing_on_layout 
    265274    get :rendering_nothing_on_layout