diff options
author | Marcel Molina <marcel@vernix.org> | 2006-05-17 07:25:36 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2006-05-17 07:25:36 +0000 |
commit | 7252666b74e00c569b431d1a798fb7280923929f (patch) | |
tree | 2f6ba0b6fbf8cfcccfac4ae4496b15484068fb03 /actionpack/lib/action_controller | |
parent | 36d1a2f302817815e0e70334733d2daf1a14a4f5 (diff) | |
download | rails-7252666b74e00c569b431d1a798fb7280923929f.tar.gz rails-7252666b74e00c569b431d1a798fb7280923929f.tar.bz2 rails-7252666b74e00c569b431d1a798fb7280923929f.zip |
Add layout attribute to response object with the name of the layout that was rendered, or nil if none rendered. [Kevin Clark kevin.clark@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4346 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/layout.rb | 1 | ||||
-rwxr-xr-x | actionpack/lib/action_controller/response.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index f27e42ea17..e421f8ed9e 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -249,6 +249,7 @@ module ActionController #:nodoc: erase_render_results add_variables_to_assigns @template.instance_variable_set("@content_for_layout", content_for_layout) + @response.layout = layout render_text(@template.render_file(layout, true), deprecated_status) else render_with_no_layout(options, deprecated_status, &block) diff --git a/actionpack/lib/action_controller/response.rb b/actionpack/lib/action_controller/response.rb index 746d6097be..2bec477647 100755 --- a/actionpack/lib/action_controller/response.rb +++ b/actionpack/lib/action_controller/response.rb @@ -1,7 +1,7 @@ module ActionController class AbstractResponse #:nodoc: DEFAULT_HEADERS = { "Cache-Control" => "no-cache" } - attr_accessor :body, :headers, :session, :cookies, :assigns, :template, :redirected_to, :redirected_to_method_params + attr_accessor :body, :headers, :session, :cookies, :assigns, :template, :redirected_to, :redirected_to_method_params, :layout def initialize @body, @headers, @session, @assigns = "", DEFAULT_HEADERS.merge("cookie" => []), [], [] |