2008-10-27 01:47:01 -05:00
|
|
|
# Legacy TemplateHandler stub
|
|
|
|
module ActionView
|
2009-02-04 14:26:08 -06:00
|
|
|
module TemplateHandlers #:nodoc:
|
2008-10-27 01:47:01 -05:00
|
|
|
module Compilable
|
2009-02-04 14:26:08 -06: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-17 23:22:34 -05:00
|
|
|
end
|
2008-10-27 01:47:01 -05:00
|
|
|
end
|
2008-05-17 23:22:34 -05:00
|
|
|
|
2008-10-27 01:47:01 -05:00
|
|
|
class TemplateHandler
|
|
|
|
def self.call(template)
|
2009-02-04 14:26:08 -06: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-17 23:22:34 -05:00
|
|
|
end
|
2007-12-21 01:48:59 -06:00
|
|
|
end
|
|
|
|
end
|