Permalink
Browse files

This is handled by the resolver now

  • Loading branch information...
1 parent 70a440a commit 9b506484f1e72aeba2f1fd4af3e39cf450f1d4a9 @wycats wycats committed Aug 7, 2009
Showing with 5 additions and 24 deletions.
  1. +5 −24 actionpack/lib/action_view/render/partials.rb
@@ -200,9 +200,12 @@ def _render_partial(options = {}) #:nodoc:
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 @@ def _partial_path(object)
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)))

0 comments on commit 9b50648

Please sign in to comment.