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

Changeset 1372

Show
Ignore:
Timestamp:
05/30/05 09:12:12 (3 years ago)
Author:
minam
Message:

render(:inline) defaults to :layout => false

Files:

Legend:

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

    r1371 r1372  
    11*SVN* 
     2 
     3* render(:inline) always defaults to :layout => false. 
    24 
    35* Make sure the benchmarking render method always returns the output of the render. 
  • trunk/actionpack/lib/action_controller/layout.rb

    r1369 r1372  
    222222        return options unless options.is_a?(Hash) 
    223223        case 
    224         when options[:text], options[:partial], options[:nothing] 
    225           # by default, :text, :partial, and :nothing never use a layout 
     224        when options[:text], options[:partial], options[:nothing], options[:inline] 
     225          # by default, :text, :partial, :inline, and :nothing never use a layout 
    226226          { :layout => false }.merge(options) 
    227227        else 
  • trunk/actionpack/test/controller/new_render_test.rb

    r1371 r1372  
    8989  def accessing_params_in_template 
    9090    render :inline =>  "Hello: <%= params[:name] %>" 
     91  end 
     92 
     93  def accessing_params_in_template_with_layout 
     94    render :inline =>  "Hello: <%= params[:name] %>", :layout => nil 
    9195  end 
    9296 
     
    98102        when "layout_test", "rendering_without_layout", 
    99103             "rendering_nothing_on_layout", "render_text_hello_world", 
    100              "partial_only", "partial_only_with_layout" 
     104             "partial_only", "partial_only_with_layout", 
     105             "accessing_params_in_template", 
     106             "accessing_params_in_template_with_layout" 
    101107          "layouts/standard" 
    102108        when "builder_layout_test" 
     
    238244    assert_equal "Hello: David", @response.body 
    239245  end 
     246 
     247  def test_accessing_params_in_template_with_layout 
     248    get :accessing_params_in_template_with_layout, :name => "David" 
     249    assert_equal "<html>Hello: David</html>", @response.body 
     250  end 
    240251end