Question about _pick_template and template_file_extension


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, 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/
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
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}.#
elsif template_file_extension && template = self.view_paths["#
elsif template = self.view_paths[template_file_name]

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

I created a ticket at LH:
and attached a patch to it. It applies to 2.2 branch