diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 945246a39a..511858dd9b 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -317,7 +317,8 @@ module ActionView #:nodoc: template elsif template = self.view_paths[template_file_name] template - elsif @_render_stack.first && template = self.view_paths["#{template_file_name}.#{@_render_stack.first.format_and_extension}"] + elsif (first_render = @_render_stack.first) && first_render.respond_to?(:format_and_extension) && + (template = self.view_paths["#{template_file_name}.#{first_render.format_and_extension}"]) template elsif template_format == :js && template = self.view_paths["#{template_file_name}.html"] @template_format = :html |