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/base.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/base.rb')
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index be04012b9f..225a61f43e 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -637,10 +637,11 @@ module ActionController #:nodoc: end def render_action(action_name, status = nil, with_layout = true) - if with_layout - render_with_layout(default_template_name(action_name), status) + template = default_template_name(action_name) + if with_layout && !template_exempt_from_layout?(template) + render_with_layout(template, status) else - render_with_no_layout(default_template_name(action_name), status) + render_without_layout(template, status) end end @@ -919,6 +920,10 @@ module ActionController #:nodoc: @template.file_public?(template_name) end + def template_exempt_from_layout?(template_name = default_template_name) + @template.javascript_template_exists?(template_name) + end + def assert_existance_of_template_file(template_name) unless template_exists?(template_name) || ignore_missing_templates full_template_path = @template.send(:full_template_path, template_name, 'rhtml') |