diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-13 02:14:31 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-13 02:14:31 +0000 |
commit | 07d8f46b85b08187cabd477cc3ca37f2c818e9aa (patch) | |
tree | 56e151cd3fbd57e6d86e2ff19efe4b429874c0ab /actionpack/lib/action_controller/layout.rb | |
parent | 93db1989fe1146ea79e3b0b2252542408ff86443 (diff) | |
download | rails-07d8f46b85b08187cabd477cc3ca37f2c818e9aa.tar.gz rails-07d8f46b85b08187cabd477cc3ca37f2c818e9aa.tar.bz2 rails-07d8f46b85b08187cabd477cc3ca37f2c818e9aa.zip |
Consistent public/protected/private visibility for chained methods. Closes #7813.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/layout.rb')
-rw-r--r-- | actionpack/lib/action_controller/layout.rb | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index 115fd7ac18..ca070d0577 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -233,31 +233,32 @@ module ActionController #:nodoc: end end - def render_with_a_layout(options = nil, deprecated_status = nil, deprecated_layout = nil, &block) #:nodoc: - template_with_options = options.is_a?(Hash) + protected + def render_with_a_layout(options = nil, deprecated_status = nil, deprecated_layout = nil, &block) #:nodoc: + template_with_options = options.is_a?(Hash) - if apply_layout?(template_with_options, options) && (layout = pick_layout(template_with_options, options, deprecated_layout)) - assert_existence_of_template_file(layout) + if apply_layout?(template_with_options, options) && (layout = pick_layout(template_with_options, options, deprecated_layout)) + assert_existence_of_template_file(layout) - options = options.merge :layout => false if template_with_options - logger.info("Rendering template within #{layout}") if logger + options = options.merge :layout => false if template_with_options + logger.info("Rendering template within #{layout}") if logger - if template_with_options - content_for_layout = render_with_no_layout(options, &block) - deprecated_status = options[:status] || deprecated_status + if template_with_options + content_for_layout = render_with_no_layout(options, &block) + deprecated_status = options[:status] || deprecated_status + else + content_for_layout = render_with_no_layout(options, deprecated_status, &block) + end + + 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 - content_for_layout = render_with_no_layout(options, deprecated_status, &block) + render_with_no_layout(options, deprecated_status, &block) end - - 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) end - end private |