diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-08-07 01:51:32 -0300 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-08-07 01:51:32 -0300 |
commit | 9b506484f1e72aeba2f1fd4af3e39cf450f1d4a9 (patch) | |
tree | 9453b2337321f8132c4ba93504511abc157c25d0 /actionpack | |
parent | 70a440aa277676078e3b8baafe1101d1287e114f (diff) | |
download | rails-9b506484f1e72aeba2f1fd4af3e39cf450f1d4a9.tar.gz rails-9b506484f1e72aeba2f1fd4af3e39cf450f1d4a9.tar.bz2 rails-9b506484f1e72aeba2f1fd4af3e39cf450f1d4a9.zip |
This is handled by the resolver now
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/render/partials.rb | 29 |
1 files changed, 5 insertions, 24 deletions
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))) |