Question about _pick_template and template_file_extension

Hi,

quick question about _pick_template and template_file_extension.
The template_file_extension is extracted in the method but not used
later to find a template. This leads to the case were a template isn't
found and Template.new(template_path, view_paths) is called which
triggers a performance warning.
E.g. if you have a template in: app/views/information/scripts.js
which you try to include with: render :file => 'information/
scripts.js'
the lookup isn't checking for "information/scripts.js" in the
view_paths if the rendered format for the page is html.
Only these cases are checked:
self.view_paths["#{template_file_name}.#{template_format}"] and
self.view_paths[template_file_name]
which both don't exist.
So the question is if there shouldn't be a case in between like so:
if template = self.view_paths["#{template_file_name}.#
{template_format}"]
  template
elsif template_file_extension && template = self.view_paths["#
{template_file_name}.#{template_file_extension}"]
  template
elsif template = self.view_paths[template_file_name]
  template

Thanks, Daniel

Ah, so its not picking up templates w/o an extension.

Seems like a legit bug. Could you please wrap this up in a patch and
create a LH ticket.

I think files w/o an extension (in a view path) should be renderable
without a template handler. I don't think they should be erb
processed.

I created a ticket at LH:
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1798-render-template-without-templatehandler-extension
and attached a patch to it. It applies to 2.2 branch