From 6228220c9b8a3bb32f8617ad2d963dabc965376e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 9 Sep 2008 17:25:09 -0500 Subject: Revert "Revert "Add layout functionality to mailers."" This reverts commit 36c6aa01ee0a7aee5b0510a8e649c44de318b060. --- actionpack/lib/action_controller/layout.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index 455e242c22..3631ce86af 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -216,7 +216,7 @@ module ActionController #:nodoc: # object). If the layout was defined without a directory, layouts is assumed. So layout "weblog/standard" will return # weblog/standard, but layout "standard" will return layouts/standard. def active_layout(passed_layout = nil) - layout = passed_layout || self.class.default_layout(response.template.template_format) + layout = passed_layout || self.class.default_layout(default_template_format) active_layout = case layout when String then layout when Symbol then __send__(layout) @@ -276,5 +276,9 @@ module ActionController #:nodoc: rescue ActionView::MissingTemplate false end + + def default_template_format + response.template.template_format + end end end -- cgit v1.2.3