-# Copyright 2008 Wincent Colaiuta
+# Copyright 2008-2009 Wincent Colaiuta
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
module Wikitext
class TemplateHandler
- def initialize view; end
- def render text, locals = {}
- text.w
+ # tested with Rails 2.2.2: the API has now changed so many times that I'm no longer going to support older versions of Rails
+ def self.call template
+ 'template.source.w'
end
end
end
-
-if ActionView::Template.respond_to? :register_template_handler # Rails 2.1.0_RC1 and above
- ActionView::Template.register_template_handler :wikitext, Wikitext::TemplateHandler
-elsif ActionView::Base.respond_to? :register_template_handler # Rails 2.0.2
- ActionView::Base.register_template_handler :wikitext, Wikitext::TemplateHandler
-else
- raise "Incompatible Rails API version (can't find register_template_handler method)"
-end