private Method

Base.compile_and_render_template(handler, template)

Render the provided template with the given local assigns. If the template has not been rendered with the provided local assigns yet, or if the template has been updated on disk, then the template will be compiled to a method.

Either, but not both, of template and file_path may be nil. If file_path is given, the template will only be read if it has to be compiled.

Source Code

# File action_view/base.rb, line 380
def compile_and_render_template(handler, template) #:nodoc:
  # compile the given template, if necessary
  handler.compile_template(template)

  # Get the method name for this template and run it
  method_name = @@method_names[template.method_key]
  evaluate_assigns

  send(method_name, template.locals) do |*name|
    instance_variable_get "@content_for_#{name.first || 'layout'}"
  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.