aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-09-18 23:10:34 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-09-18 23:10:34 +0000
commit0d99423727ce309ce4b2c5439575eab75dcf49eb (patch)
tree565635bb0b28e66291b446cf98aec132d8de9d70 /actionpack/lib/action_controller
parent2f60bb3327453ef214b78ed99c7e7c034774bb81 (diff)
downloadrails-0d99423727ce309ce4b2c5439575eab75dcf49eb.tar.gz
rails-0d99423727ce309ce4b2c5439575eab75dcf49eb.tar.bz2
rails-0d99423727ce309ce4b2c5439575eab75dcf49eb.zip
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
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/layout.rb4
1 files changed, 3 insertions, 1 deletions
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)