<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,9 +12,9 @@ module ActionController #:nodoc:
         # modified to return an absolute path
         show_layout = options.has_key?(:layout) ? options[:layout] : (options[:partial] ? false : true)
         render_without_active_scaffold(
-          :file          =&gt; rewrite_template_path_for_active_scaffold(path_val),
+          :file          =&gt; path_val,
           :locals        =&gt; {:payload =&gt; render_to_string(options.merge(:layout =&gt; false), &amp;block)},
-          :use_full_path =&gt; false,
+          :use_full_path =&gt; true,
           :layout        =&gt; show_layout
         )
         @rendering_adapter = nil # recursion control
@@ -23,24 +23,5 @@ module ActionController #:nodoc:
       end
     end
     alias_method_chain :render, :active_scaffold unless method_defined?(:render_without_active_scaffold)
-
-    private
-
-    def rewrite_template_path_for_active_scaffold(path)
-      base = File.join RAILS_ROOT, 'app', 'views'
-      # check the ActiveScaffold-specific directories
-      active_scaffold_config.template_search_path.each do |template_path|
-        search_dir = File.join base, template_path
-        next unless File.exists?(search_dir)
-        # ACC I'm using this regex directory search because I don't know how to hook into the
-        # rails code that would do this for me. I am assuming here that path is a non-nested
-        # partial, so my regex is fragile, and will only work in that case. 
-        template_file = Dir.entries(search_dir).find {|f| f =~ /^#{path}/ }
-        # ACC pick_template and template_exists? are the same method (aliased), using both versions
-        # to express intent.
-        return File.join(search_dir, template_file) if template_exists?(template_file)
-      end
-      return path
-    end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/extensions/action_controller_rendering.rb</filename>
    </modified>
    <modified>
      <diff>@@ -53,10 +53,9 @@ else
       if @template.controller.class.uses_active_scaffold?
         path = pick_template_without_generic_paths(template_path, extension)
         return path if (path &amp;&amp; ! path.empty?)
-        template_file = File.basename(template_path)
-        template_path = find_generic_base_path_for(template_file, extension)
+        template_file = &quot;#{File.basename(template_path)}.#{extension}&quot;
         # ACC return absolute path to file
-        template_path
+        find_generic_base_path_for(template_file)
       else
         pick_template_without_generic_paths(template_path, extension)
       end
@@ -64,13 +63,14 @@ else
     alias_method_chain :pick_template, :generic_paths
     alias_method :template_exists?, :pick_template
 
-    # Returns the view path that contains the relative template 
-    def find_generic_base_path_for(template_file_name, extension)
-      # ACC TODO use more robust method of setting this path
-      path = RAILS_ROOT + '/vendor/plugins/active_scaffold/frontends/default/views'
-      # Should be able to use a rails method here to do this directory search
-      file = Dir.entries(path).find {|f| f =~ /^_?#{template_file_name}\.?#{extension}/ }
-      file ? File.join(path, file) : nil
+
+    # robd: TODO hook this in to @view_paths so we don't have to check the file system every time.
+    def find_generic_base_path_for(template_file)
+      @template.controller.generic_view_paths.each do |as_path|
+        file_path_in_as_view_dir = File.join(as_path, template_file)
+        return file_path_in_as_view_dir if File.exists?(file_path_in_as_view_dir)
+      end
+      nil
     end
 
     def find_template_extension_from_handler_with_generics(template_path, template_format = @template.template_format)</diff>
      <filename>lib/extensions/generic_view_paths.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>52d0777e5b75d934d02f3aa7665452b5b9c2d90f</id>
    </parent>
  </parents>
  <author>
    <name>Rob Dupuis</name>
    <email>github@robd.co.uk</email>
  </author>
  <url>http://github.com/robd/active_scaffold/commit/08de033ba02f8a9ad60dce91e2ac8c9fcd849592</url>
  <id>08de033ba02f8a9ad60dce91e2ac8c9fcd849592</id>
  <committed-date>2008-06-26T05:12:45-07:00</committed-date>
  <authored-date>2008-06-26T05:12:45-07:00</authored-date>
  <message>Rails 2.1 template finder now checks generic file paths for template loading</message>
  <tree>9300407a68484ff57e1e3100ad7a0c51332187fa</tree>
  <committer>
    <name>Rob Dupuis</name>
    <email>github@robd.co.uk</email>
  </committer>
</commit>
