static public Method

Base.register_template_handler(extension, klass)

Register a class that knows how to handle template files with the given extension. This can be used to implement new template types. The constructor for the class must take the ActiveView::Base instance as a parameter, and the class must implement a #render method that takes the contents of the template to render as well as the Hash of local assigns available to the template. The #render method ought to return the rendered template as a string.

Source Code

# File action_view/base.rb, line 242
def self.register_template_handler(extension, klass)
  @@template_handlers[extension.to_sym] = klass
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.