Permalink
Browse files

Use File.join to construct partial path. Closes #10932 [patrick.t.jo…

…yce]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8739 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 6e165b8 commit 5ac3a9bd0b4cfd6aa7ad585ae6dde206c2e32bb0 @NZKoz NZKoz committed Jan 27, 2008
Showing with 4 additions and 3 deletions.
  1. +4 −3 actionpack/lib/action_view/partials.rb
@@ -107,17 +107,18 @@ def render_partial(partial_path, object_assigns = nil, local_assigns = nil) #:no
case partial_path
when String, Symbol, NilClass
path, partial_name = partial_pieces(partial_path)
+ full_partial_path = File.join(path, "_#{partial_name}")
object = extracting_object(partial_name, object_assigns)
local_assigns = local_assigns ? local_assigns.clone : {}
add_counter_to_local_assigns!(partial_name, local_assigns)
add_object_to_local_assigns!(partial_name, local_assigns, object)
if logger && logger.debug?
- ActionController::Base.benchmark("Rendered #{path}/_#{partial_name}", Logger::DEBUG, false) do
- render("#{path}/_#{partial_name}", local_assigns)
+ ActionController::Base.benchmark("Rendered #{full_partial_path}", Logger::DEBUG, false) do
+ render(full_partial_path, local_assigns)
end
else
- render("#{path}/_#{partial_name}", local_assigns)
+ render(full_partial_path, local_assigns)
end
when ActionView::Helpers::FormBuilder
builder_partial_path = partial_path.class.to_s.demodulize.underscore.sub(/_builder$/, '')

0 comments on commit 5ac3a9b

Please sign in to comment.