From 74436d2203eba186baebc1ddc82ff2202d0fc005 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Thu, 1 May 2008 10:21:46 +0100 Subject: Fixed render :template for templates in top level of view path. [#54 state:resolved] --- actionpack/lib/action_view/template_finder.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') 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(/^\//, '') -- cgit v1.2.3