<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>actionpack/test/fixtures/shared.html.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -24,7 +24,12 @@ module ActionView #:nodoc:
         view_paths.flatten.compact.each do |dir|
           next if @@processed_view_paths.has_key?(dir)
           @@processed_view_paths[dir] = []
-          Dir.glob(&quot;#{dir}/**/*/**&quot;).each do |file|
+          
+          # 
+          # Dir.glob(&quot;#{dir}/**/*/**&quot;) reads all the directories in view path and templates inside those directories
+          # Dir.glob(&quot;#{dir}/**&quot;) reads templates residing at top level of view path
+          # 
+          (Dir.glob(&quot;#{dir}/**/*/**&quot;) | Dir.glob(&quot;#{dir}/**&quot;)).each do |file|
             unless File.directory?(file)
               @@processed_view_paths[dir] &lt;&lt; file.split(dir).last.sub(/^\//, '')
 </diff>
      <filename>actionpack/lib/action_view/template_finder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,14 @@ class TestController &lt; ActionController::Base
   def render_hello_world_with_forward_slash
     render :template =&gt; &quot;/test/hello_world&quot;
   end
+  
+  def render_template_in_top_directory
+    render :template =&gt; 'shared'
+  end
+  
+  def render_template_in_top_directory_with_slash
+    render :template =&gt; '/shared'
+  end
 
   def render_hello_world_from_variable
     @person = &quot;david&quot;
@@ -243,6 +251,18 @@ class RenderTest &lt; Test::Unit::TestCase
     get :render_hello_world_with_forward_slash
     assert_template &quot;test/hello_world&quot;
   end
+  
+  def test_render_in_top_directory
+    get :render_template_in_top_directory
+    assert_template &quot;shared&quot;
+    assert_equal &quot;Elastica&quot;, @response.body
+  end
+  
+  def test_render_in_top_directory_with_slash
+    get :render_template_in_top_directory_with_slash
+    assert_template &quot;shared&quot;
+    assert_equal &quot;Elastica&quot;, @response.body
+  end
 
   def test_render_from_variable
     get :render_hello_world_from_variable</diff>
      <filename>actionpack/test/controller/render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,13 +21,14 @@ class TemplateFinderTest &lt; Test::Unit::TestCase
     assert_equal [&quot;builder&quot;, &quot;erb&quot;, &quot;rhtml&quot;, &quot;rjs&quot;, &quot;rxml&quot;, &quot;mab&quot;].sort,
                  ActionView::TemplateFinder.file_extension_cache[LOAD_PATH_ROOT].values.flatten.uniq.sort
 
-    assert_equal Dir.glob(&quot;#{LOAD_PATH_ROOT}/**/*/*.{erb,rjs,rhtml,builder,rxml,mab}&quot;).size,
+    assert_equal (Dir.glob(&quot;#{LOAD_PATH_ROOT}/**/*/*.{erb,rjs,rhtml,builder,rxml,mab}&quot;) |
+                  Dir.glob(&quot;#{LOAD_PATH_ROOT}/**.{erb,rjs,rhtml,builder,rxml,mab}&quot;)).size,
                  ActionView::TemplateFinder.file_extension_cache[LOAD_PATH_ROOT].keys.size
   end
 
   def test_should_cache_dir_content_properly
     assert ActionView::TemplateFinder.processed_view_paths[LOAD_PATH_ROOT]
-    assert_equal Dir.glob(&quot;#{LOAD_PATH_ROOT}/**/*/**&quot;).find_all {|f| !File.directory?(f) }.size,
+    assert_equal (Dir.glob(&quot;#{LOAD_PATH_ROOT}/**/*/**&quot;) | Dir.glob(&quot;#{LOAD_PATH_ROOT}/**&quot;)).find_all {|f| !File.directory?(f) }.size,
                ActionView::TemplateFinder.processed_view_paths[LOAD_PATH_ROOT].size
   end
 </diff>
      <filename>actionpack/test/template/template_finder_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6f20efdaf733db26fbf337da73121983785064d5</id>
    </parent>
  </parents>
  <author>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/74436d2203eba186baebc1ddc82ff2202d0fc005</url>
  <id>74436d2203eba186baebc1ddc82ff2202d0fc005</id>
  <committed-date>2008-05-01T02:21:46-07:00</committed-date>
  <authored-date>2008-05-01T02:21:46-07:00</authored-date>
  <message>Fixed render :template for templates in top level of view path. [#54 state:resolved]</message>
  <tree>e5a8b5297edec740d5121275d19af7805a32bae0</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
