2008-10-27 07:47:01 +01:00
|
|
|
# Legacy TemplateHandler stub
|
|
|
|
module ActionView
|
2009-02-04 21:26:08 +01:00
|
|
|
module TemplateHandlers #:nodoc:
|
2008-10-27 07:47:01 +01:00
|
|
|
module Compilable
|
2009-02-04 21:26:08 +01:00
|
|
|
def self.included(base)
|
|
|
|
base.extend(ClassMethods)
|
|
|
|
end
|
|
|
|
|
|
|
|
module ClassMethods
|
|
|
|
def call(template)
|
|
|
|
new.compile(template)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def compile(template)
|
|
|
|
raise "Need to implement #{self.class.name}#compile(template)"
|
|
|
|
end
|
2008-05-18 06:22:34 +02:00
|
|
|
end
|
2008-10-27 07:47:01 +01:00
|
|
|
end
|
2008-05-18 06:22:34 +02:00
|
|
|
|
2008-10-27 07:47:01 +01:00
|
|
|
class TemplateHandler
|
|
|
|
def self.call(template)
|
2009-02-04 21:26:08 +01:00
|
|
|
"#{name}.new(self).render(template, local_assigns)"
|
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(view = nil)
|
|
|
|
@view = view
|
|
|
|
end
|
|
|
|
|
|
|
|
def render(template, local_assigns)
|
|
|
|
raise "Need to implement #{self.class.name}#render(template, local_assigns)"
|
2008-05-18 06:22:34 +02:00
|
|
|
end
|
2007-12-21 08:48:59 +01:00
|
|
|
end
|
|
|
|
end
|