Gets the extension for an existing template with the given template_path. Returns the format with the extension if that template exists.
pick_template_extension('users/show') # => 'html.erb' pick_template_extension('users/legacy') # => "rhtml"
Source Code
# File action_view/base.rb, line 395 def pick_template_extension(template_path)#:nodoc: if @@cache_template_extensions (@@cached_template_extension[template_path] ||= {})[template_format] ||= find_template_extension_for(template_path) else find_template_extension_for(template_path) end end
<code/>and<pre/>for code samples.