From 8c7d54a50f2dc1e97d7ddf5561e2ac6d3f569b83 Mon Sep 17 00:00:00 2001 From: Jan De Poorter Date: Mon, 7 Jun 2010 15:03:07 +0200 Subject: [PATCH] Make sure a namespaced <%= render form %> still renders the _form partial --- actionpack/lib/action_view/render/partials.rb | 2 +- actionpack/test/controller/render_test.rb | 11 +++++++++++ actionpack/test/fixtures/fun/games/_form.erb | 1 + 3 files changed, 13 insertions(+), 1 deletions(-) create mode 100644 actionpack/test/fixtures/fun/games/_form.erb diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb index 85f67d4..fd896c2 100644 --- a/actionpack/lib/action_view/render/partials.rb +++ b/actionpack/lib/action_view/render/partials.rb @@ -316,7 +316,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 diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 2b1f2a2..d0027cc 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -7,6 +7,10 @@ module Fun # :ported: def hello_world end + + def nested_partial_with_form_builder + render :partial => ActionView::Helpers::FormBuilder.new(:post, nil, view_context, {}, Proc.new {}) + end end end @@ -1230,6 +1234,13 @@ class RenderTest < ActionController::TestCase assert_match(/