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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---