Changeset 1424
- Timestamp:
- 06/15/05 13:20:17 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (2 diffs)
- trunk/actionpack/lib/action_controller/layout.rb (modified) (1 diff)
- trunk/actionpack/test/controller/new_render_test.rb (modified) (3 diffs)
- trunk/actionpack/test/controller/render_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r1422 r1424 1 1 *SVN* 2 2 3 * render("foo/bar") works with a layout again 4 3 5 * Fixed double-singularization on scaffolded pagination call (Address would be turned into Addres) #1216, #1404 [nilsga] 4 6 … … 25 27 * Make sure the benchmarking render method always returns the output of the render. 26 28 27 * render(:action) and render() are the only twocalls that default to using a layout. All other render calls assume :layout => false. This also fixes send_file, which was applying a layout if one existed for the current action.29 * render(:action), render(:template) and render() are the only three calls that default to using a layout. All other render calls assume :layout => false. This also fixes send_file, which was applying a layout if one existed for the current action. 28 30 29 31 * verify with :redirect_to won't redirect if a redirect or render has already been performed #1350 trunk/actionpack/lib/action_controller/layout.rb
r1378 r1424 220 220 private 221 221 def render_with_a_layout_options(options) 222 return optionsunless options.is_a?(Hash)223 if options.values_at(:text, :file, : template, :inline, :partial, :nothing).compact.empty?222 return { :template => options } unless options.is_a?(Hash) 223 if options.values_at(:text, :file, :inline, :partial, :nothing).compact.empty? 224 224 options 225 225 else trunk/actionpack/test/controller/new_render_test.rb
r1378 r1424 93 93 def accessing_params_in_template_with_layout 94 94 render :inline => "Hello: <%= params[:name] %>", :layout => nil 95 end 96 97 def render_with_explicit_template 98 render "test/hello_world" 95 99 end 96 100 … … 104 108 "partial_only", "partial_only_with_layout", 105 109 "accessing_params_in_template", 106 "accessing_params_in_template_with_layout" 110 "accessing_params_in_template_with_layout", 111 "render_with_explicit_template" 107 112 "layouts/standard" 108 113 when "builder_layout_test" … … 250 255 assert_equal "<html>Hello: David</html>", @response.body 251 256 end 257 258 def test_render_with_explicit_template 259 get :render_with_explicit_template 260 assert_response :success 261 end 252 262 end trunk/actionpack/test/controller/render_test.rb
r1371 r1424 89 89 Fun::GamesController.template_root = File.dirname(__FILE__) + "/../fixtures/" 90 90 91 class TestLayoutController < ActionController::Base92 layout "layouts/standard"93 94 def hello_world95 end96 97 def hello_world_outside_layout98 end99 100 def rescue_action(e)101 raise unless ActionController::MissingTemplate === e102 end103 end104 105 91 class RenderTest < Test::Unit::TestCase 106 92 def setup