Permalink
Browse files

The view context always responds to controller, check if controller a…

…vailable instead
  • Loading branch information...
1 parent fe26405 commit a916c2e3d316c8338fa1d9d15f449403bddddf11 @josh josh committed Aug 25, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/partials.rb
View
2 actionpack/lib/action_view/partials.rb
@@ -190,7 +190,7 @@ def render_partial_collection(options = {}) #:nodoc:
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}"

0 comments on commit a916c2e

Please sign in to comment.