aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorLuke Melia <luke@lukemelia.com>2008-11-18 15:16:43 -0600
committerJoshua Peek <josh@joshpeek.com>2008-11-18 15:19:16 -0600
commit60d6f255177af3ca93721abb8551c8585fc8c67d (patch)
treedf193a3988854c7ba98ba5846a0f60d916de9aa5 /actionpack/lib/action_view
parent9c01d3cead2b071d27f06690df73d6b579a18f4f (diff)
downloadrails-60d6f255177af3ca93721abb8551c8585fc8c67d.tar.gz
rails-60d6f255177af3ca93721abb8551c8585fc8c67d.tar.bz2
rails-60d6f255177af3ca93721abb8551c8585fc8c67d.zip
Fix rendering html partial via inline render when with :js format [#1399 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/base.rb3
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