Changeset 1378
- Timestamp:
- 06/01/05 13:39:58 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/base.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/layout.rb (modified) (2 diffs)
- trunk/actionpack/test/controller/new_render_test.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r1372 r1378 1 1 *SVN* 2 2 3 * render(: inline) always defaults to :layout => false.3 * render(:layout => true) is a synonym for render(:layout => nil) 4 4 5 5 * Make sure the benchmarking render method always returns the output of the render. 6 6 7 * render(: text), render(:partial), and render(:nothing) always default to:layout => false. This also fixes send_file, which was applying a layout if one existed for the current action.7 * render(:action) and render() are the only two 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. 8 8 9 9 * verify with :redirect_to won't redirect if a redirect or render has already been performed #1350 trunk/actionpack/lib/action_controller/base.rb
r1366 r1378 491 491 492 492 else 493 render(options.merge({ : template => default_template_name }))493 render(options.merge({ :action => action_name })) 494 494 end 495 495 end trunk/actionpack/lib/action_controller/layout.rb
r1372 r1378 221 221 def render_with_a_layout_options(options) 222 222 return options unless options.is_a?(Hash) 223 case224 when options[:text], options[:partial], options[:nothing], options[:inline]225 # by default, :text, :partial, :inline, and :nothing never use a layout223 if options.values_at(:text, :file, :template, :inline, :partial, :nothing).compact.empty? 224 options 225 else 226 226 { :layout => false }.merge(options) 227 else228 options229 227 end 230 228 end … … 237 235 when FalseClass 238 236 nil 239 when NilClass 237 when NilClass, TrueClass 240 238 active_layout if action_has_layout? 241 239 else trunk/actionpack/test/controller/new_render_test.rb
r1372 r1378 79 79 80 80 def partial_only_with_layout 81 render :partial => "partial_only", :layout => nil81 render :partial => "partial_only", :layout => true 82 82 end 83 83 … … 100 100 def determine_layout 101 101 case action_name 102 when " layout_test", "rendering_without_layout",102 when "hello_world", "layout_test", "rendering_without_layout", 103 103 "rendering_nothing_on_layout", "render_text_hello_world", 104 104 "partial_only", "partial_only_with_layout", … … 133 133 assert_response :success 134 134 assert_template "test/hello_world" 135 assert_equal "<html>Hello world!</html>", @response.body 135 136 end 136 137