Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

updating documentation for register_template_handler

  • Loading branch information...
commit 03ae795593aef21dc39e96f15305421caea28772 1 parent 66fc1d6
James A. Rosen authored
Showing with 5 additions and 8 deletions.
  1. +5 −8 actionpack/lib/action_view/template/handlers.rb
13 actionpack/lib/action_view/template/handlers.rb
@@ -17,15 +17,12 @@ def self.extensions
@@template_extensions ||= @@template_handlers.keys
- # Register a class that knows how to handle template files with the given
+ # Register an object 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.
- def register_template_handler(extension, klass)
- @@template_handlers[extension.to_sym] = klass
+ # The handler must respond to `:call`, which will be passed the template
+ # and should return the rendered template as a String.
+ def register_template_handler(extension, handler)
+ @@template_handlers[extension.to_sym] = handler
def template_handler_extensions
Please sign in to comment.
Something went wrong with that request. Please try again.