diff options
author | Marcel Molina <marcel@vernix.org> | 2005-11-18 08:32:17 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2005-11-18 08:32:17 +0000 |
commit | 62fe5bbfb1493bd069a1ebcb5ee45531e49a6582 (patch) | |
tree | 490a981041ff2a4d4c51bbd302d311926331f840 /actionpack/lib/action_controller/layout.rb | |
parent | 97d5f4acdfb986c5dc26f7c48518ef8a7d26f8bb (diff) | |
download | rails-62fe5bbfb1493bd069a1ebcb5ee45531e49a6582.tar.gz rails-62fe5bbfb1493bd069a1ebcb5ee45531e49a6582.tar.bz2 rails-62fe5bbfb1493bd069a1ebcb5ee45531e49a6582.zip |
Make rjs templates always implicitly skip out on layouts.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/layout.rb')
-rw-r--r-- | actionpack/lib/action_controller/layout.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index 815a55739f..caf29ea113 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -229,11 +229,13 @@ module ActionController #:nodoc: private def apply_layout?(template_with_options, options) - if template_with_options - (options.has_key?(:layout) && options[:layout]!=false) || options.values_at(:text, :file, :inline, :partial, :nothing).compact.empty? - else - true - end + template_with_options ? candidate_for_layout?(options) : !template_exempt_from_layout? + end + + def candidate_for_layout?(options) + (options.has_key?(:layout) && options[:layout] != false) || + options.values_at(:text, :file, :inline, :partial, :nothing).compact.empty? && + !template_exempt_from_layout?(default_template_name(options[:action])) end def pick_layout(template_with_options, options, deprecated_layout) |