public Method

Base.pick_template_extension(template_path)

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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.