diff options
author | José Valim <jose.valim@gmail.com> | 2012-03-27 00:38:31 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-03-27 00:38:31 -0700 |
commit | e31ec4700b9e1ca4726cff46fd68442fd6364b7b (patch) | |
tree | 28e94d43197fa0e4f18368ad5d17f8b0820232c4 /actionpack/lib | |
parent | 3eb5be67b14e347951eea2dd13cd6f4a8aaaa38c (diff) | |
parent | 449a4fc0957748bca3bddf6a15e4d2ae72e2898f (diff) | |
download | rails-e31ec4700b9e1ca4726cff46fd68442fd6364b7b.tar.gz rails-e31ec4700b9e1ca4726cff46fd68442fd6364b7b.tar.bz2 rails-e31ec4700b9e1ca4726cff46fd68442fd6364b7b.zip |
Merge pull request #5603 from drogus/fix-rendered-format-for-render-partial
Fix rendered format for render partial
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/renderer/partial_renderer.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb index 17aa85555c..25c41f042b 100644 --- a/actionpack/lib/action_view/renderer/partial_renderer.rb +++ b/actionpack/lib/action_view/renderer/partial_renderer.rb @@ -221,6 +221,14 @@ module ActionView setup(context, options, block) identifier = (@template = find_partial) ? @template.identifier : @path + @lookup_context.rendered_format ||= begin + if @template && @template.formats.present? + @template.formats.first + else + formats.first + end + end + if @collection instrument(:collection, :identifier => identifier || "collection", :count => @collection.size) do render_collection @@ -273,8 +281,6 @@ module ActionView @block = block @details = extract_details(options) - @lookup_context.rendered_format ||= formats.first - if String === partial @object = options[:object] @path = partial |