diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-21 23:55:56 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-22 11:12:03 -0200 |
commit | 157ea763060e90f3aba0ff5af15d5dcb0f0c9c35 (patch) | |
tree | 5d2a3cb89c5f29f74419c42cdd7482891be56ea1 /actionpack/lib/action_view/renderer | |
parent | a95f730ea45f01744702849fc084b4d28c857964 (diff) | |
download | rails-157ea763060e90f3aba0ff5af15d5dcb0f0c9c35.tar.gz rails-157ea763060e90f3aba0ff5af15d5dcb0f0c9c35.tar.bz2 rails-157ea763060e90f3aba0ff5af15d5dcb0f0c9c35.zip |
format lookup for partials is derived from the format in which the template is being rendered
Closes #5025 part 2
Diffstat (limited to 'actionpack/lib/action_view/renderer')
-rw-r--r-- | actionpack/lib/action_view/renderer/abstract_renderer.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/renderer/template_renderer.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderer/abstract_renderer.rb b/actionpack/lib/action_view/renderer/abstract_renderer.rb index a588abcee3..52473cd222 100644 --- a/actionpack/lib/action_view/renderer/abstract_renderer.rb +++ b/actionpack/lib/action_view/renderer/abstract_renderer.rb @@ -1,7 +1,7 @@ module ActionView class AbstractRenderer #:nodoc: delegate :find_template, :template_exists?, :with_fallbacks, :update_details, - :with_layout_format, :formats, :freeze_formats, :to => :@lookup_context + :with_layout_format, :formats, :to => :@lookup_context def initialize(lookup_context) @lookup_context = lookup_context diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb index f3abc6d533..20f75fba45 100644 --- a/actionpack/lib/action_view/renderer/template_renderer.rb +++ b/actionpack/lib/action_view/renderer/template_renderer.rb @@ -6,7 +6,8 @@ module ActionView @view = context @details = extract_details(options) template = determine_template(options) - freeze_formats(template.formats, true) + @lookup_context.rendered_format ||= template.formats.first + @lookup_context.formats = template.formats render_template(template, options[:layout], options[:locals]) end |