aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/handler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/template/handler.rb')
-rw-r--r--actionpack/lib/action_view/template/handler.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template/handler.rb b/actionpack/lib/action_view/template/handler.rb
new file mode 100644
index 0000000000..672da0ed2b
--- /dev/null
+++ b/actionpack/lib/action_view/template/handler.rb
@@ -0,0 +1,34 @@
+# Legacy TemplateHandler stub
+module ActionView
+ module TemplateHandlers #:nodoc:
+ module Compilable
+ 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
+ end
+ end
+
+ class TemplateHandler
+ def self.call(template)
+ "#{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)"
+ end
+ end
+end