From 0d99423727ce309ce4b2c5439575eab75dcf49eb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 18 Sep 2007 23:10:34 +0000 Subject: Fixed that default layouts did not take the format into account #9564 [lifofifo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7514 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/layout.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index 0c1513c9a1..f12b3f9b80 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -234,7 +234,9 @@ module ActionController #:nodoc: protected def render_with_a_layout(options = nil, &block) #:nodoc: - template_with_options = options.is_a?(Hash) + if template_with_options = options.is_a?(Hash) + response.template.template_format = options[:content_type].to_sym if options[:content_type] + end if apply_layout?(template_with_options, options) && (layout = pick_layout(template_with_options, options)) assert_existence_of_template_file(layout) -- cgit v1.2.3