From 03ae795593aef21dc39e96f15305421caea28772 Mon Sep 17 00:00:00 2001 From: "James A. Rosen" Date: Wed, 1 Feb 2012 16:49:21 -0800 Subject: updating documentation for register_template_handler --- actionpack/lib/action_view/template/handlers.rb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'actionpack/lib/action_view/template/handlers.rb') diff --git a/actionpack/lib/action_view/template/handlers.rb b/actionpack/lib/action_view/template/handlers.rb index aa693335e3..67978ada7e 100644 --- a/actionpack/lib/action_view/template/handlers.rb +++ b/actionpack/lib/action_view/template/handlers.rb @@ -17,15 +17,12 @@ module ActionView #:nodoc: @@template_extensions ||= @@template_handlers.keys end - # 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 end def template_handler_extensions -- cgit v1.2.3