diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-09-08 19:57:32 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-09-08 19:57:32 -0700 |
commit | dc0411fad78bfc92fe92dc88bbad726eb4d1a883 (patch) | |
tree | 7533c6ecd1b711a3162cc4264228d6279b8c4b84 /actionpack/lib/action_view/base.rb | |
parent | 8b4461c1a405e52e22ee05dd8b46168402d02968 (diff) | |
download | rails-dc0411fad78bfc92fe92dc88bbad726eb4d1a883.tar.gz rails-dc0411fad78bfc92fe92dc88bbad726eb4d1a883.tar.bz2 rails-dc0411fad78bfc92fe92dc88bbad726eb4d1a883.zip |
Check for uninitialized instance variables
Diffstat (limited to 'actionpack/lib/action_view/base.rb')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 6c4da9067d..8c00670087 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -278,9 +278,9 @@ module ActionView #:nodoc: # the same name but differing formats. See +Request#template_format+ # for more details. def template_format - return @template_format if @template_format - - if controller && controller.respond_to?(:request) + if defined? @template_format + @template_format + elsif controller && controller.respond_to?(:request) @template_format = controller.request.template_format else @template_format = :html @@ -366,7 +366,9 @@ module ActionView #:nodoc: end else begin - original_content_for_layout, @content_for_layout = @content_for_layout, render(options) + original_content_for_layout = @content_for_layout if defined?(@content_for_layout) + @content_for_layout = render(options) + if (options[:inline] || options[:file] || options[:text]) @cached_content_for_layout = @content_for_layout render(:file => partial_layout, :locals => local_assigns) |