Renders the template present
at template_path. If use_full_path is set to true,
it’s relative to the template_root, otherwise it’s absolute.
The hash in local_assigns is made available as local variables.
# File actionpack/lib/action_view/base.rb, line 191
def render_file(template_path, use_full_path = true, local_assigns = {})
@first_render = template_path if @first_render.nil?
if use_full_path
template_extension = pick_template_extension(template_path)
template_file_name = full_template_path(template_path, template_extension)
else
template_file_name = template_path
template_extension = template_path.split('.').last
end
template_source = nil # Don't read the source until we know that it is required
begin
render_template(template_extension, template_source, template_file_name, local_assigns)
rescue Exception => e
if TemplateError === e
e.sub_template_of(template_file_name)
raise e
else
raise TemplateError.new(@base_path, template_file_name, @assigns, template_source, e)
end
end
end