diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-05-01 10:21:46 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-01 10:21:46 +0100 |
commit | 74436d2203eba186baebc1ddc82ff2202d0fc005 (patch) | |
tree | e5a8b5297edec740d5121275d19af7805a32bae0 /actionpack/lib | |
parent | 6f20efdaf733db26fbf337da73121983785064d5 (diff) | |
download | rails-74436d2203eba186baebc1ddc82ff2202d0fc005.tar.gz rails-74436d2203eba186baebc1ddc82ff2202d0fc005.tar.bz2 rails-74436d2203eba186baebc1ddc82ff2202d0fc005.zip |
Fixed render :template for templates in top level of view path. [#54 state:resolved]
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/template_finder.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template_finder.rb b/actionpack/lib/action_view/template_finder.rb index aaf34de538..83b7e27c09 100644 --- a/actionpack/lib/action_view/template_finder.rb +++ b/actionpack/lib/action_view/template_finder.rb @@ -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("#{dir}/**/*/**").each do |file| + + # + # Dir.glob("#{dir}/**/*/**") reads all the directories in view path and templates inside those directories + # Dir.glob("#{dir}/**") reads templates residing at top level of view path + # + (Dir.glob("#{dir}/**/*/**") | Dir.glob("#{dir}/**")).each do |file| unless File.directory?(file) @@processed_view_paths[dir] << file.split(dir).last.sub(/^\//, '') |