The view context always responds to controller, check if controller available instead

This commit is contained in:
Joshua Peek 2008-08-25 15:34:55 -05:00
parent fe2640549b
commit a916c2e3d3
1 changed files with 1 additions and 1 deletions

View File

@ -190,7 +190,7 @@ module ActionView
def _pick_partial_template(partial_path) #:nodoc:
if partial_path.include?('/')
path = File.join(File.dirname(partial_path), "_#{File.basename(partial_path)}")
elsif respond_to?(:controller)
elsif controller
path = "#{controller.class.controller_path}/_#{partial_path}"
else
path = "_#{partial_path}"