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

Changeset 7418

Show
Ignore:
Timestamp:
09/08/07 03:12:03 (1 year ago)
Author:
bitsweat
Message:

Fix layout overriding response status. Closes #9476.

Files:

Legend:

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

    r7413 r7418  
    11*SVN* 
     2 
     3* Fix layout overriding response status.  #9476 [lotswholetime] 
    24 
    35* Add fieldset_tag for generating fieldsets, closes #9477. [djanowski] 
  • trunk/actionpack/lib/action_controller/layout.rb

    r7403 r7418  
    248248          @template.instance_variable_set("@content_for_layout", content_for_layout) 
    249249          response.layout = layout 
    250           render_for_text(@template.render_file(layout, true)) 
     250          status = template_with_options ? options[:status] : nil 
     251          render_for_text(@template.render_file(layout, true), status) 
    251252        else 
    252253          render_with_no_layout(options, &block) 
  • trunk/actionpack/test/controller/layout_test.rb

    r6736 r7418  
    201201  end 
    202202end 
     203 
     204class LayoutStatusIsRendered < LayoutTest 
     205  def hello 
     206    render :status => 401 
     207  end 
     208end 
     209 
     210class LayoutStatusIsRenderedTest < Test::Unit::TestCase 
     211  def setup 
     212    @request    = ActionController::TestRequest.new 
     213    @response   = ActionController::TestResponse.new 
     214  end 
     215 
     216  def test_layout_status_is_rendered 
     217    @controller = LayoutStatusIsRendered.new 
     218    get :hello 
     219    assert_response 401 
     220  end 
     221end