From 9b506484f1e72aeba2f1fd4af3e39cf450f1d4a9 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Fri, 7 Aug 2009 01:51:32 -0300 Subject: This is handled by the resolver now --- actionpack/lib/action_view/render/partials.rb | 29 +++++---------------------- 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'actionpack/lib/action_view/render/partials.rb') diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb index 6e5810d148..3e60dcf068 100644 --- a/actionpack/lib/action_view/render/partials.rb +++ b/actionpack/lib/action_view/render/partials.rb @@ -200,9 +200,12 @@ module ActionView path = _partial_path(object) end - parts = partial_parts(path, options) + parts = [path, {:formats => formats}] + parts.push path.include?(?/) ? nil : controller_path + parts.push true + template = find_by_parts(*parts) - _render_partial_object(template, options, (parts[3] unless parts[3] == true)) + _render_partial_object(template, options) end private @@ -217,28 +220,6 @@ module ActionView end end - def partial_parts(name, options) - segments = name.split("/") - parts = segments.pop.split(".") - - case parts.size - when 1 - parts - when 2, 3 - extension = parts.delete_at(1).to_sym - if formats.include?(extension) - self.formats.replace [extension] - end - parts.pop if parts.size == 2 - end - - path = parts.join(".") - prefix = segments[0..-1].join("/") - prefix = prefix.blank? ? controller_path : prefix - parts = [path, {:formats => formats}, prefix] - parts.push options[:object] || true - end - def _render_partial_with_block(layout, block, options) @_proc_for_layout = block concat(_render_partial(options.merge(:partial => layout))) -- cgit v1.2.3