aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/render/partials.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/render/partials.rb')
-rw-r--r--actionpack/lib/action_view/render/partials.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb
index 85f67d4f14..459aae94a2 100644
--- a/actionpack/lib/action_view/render/partials.rb
+++ b/actionpack/lib/action_view/render/partials.rb
@@ -1,6 +1,8 @@
require 'active_support/core_ext/object/blank'
module ActionView
+ # = Action View Partials
+ #
# There's also a convenience method for rendering sub templates within the current controller that depends on a
# single object (we call this kind of sub templates for partials). It relies on the fact that partials should
# follow the naming convention of being prefixed with an underscore -- as to separate them from regular
@@ -316,7 +318,7 @@ module ActionView
object.class.model_name.partial_path.dup.tap do |partial|
path = @view.controller_path
- partial.insert(0, "#{File.dirname(path)}/") if path.include?(?/)
+ partial.insert(0, "#{File.dirname(path)}/") if partial.include?(?/) && path.include?(?/)
end
end
end