Permalink
Browse files

Rails 3.1 TemplateHandler compatibility.

  • Loading branch information...
1 parent 084335e commit 152718240d9757cc26385e60d9cf2482d979ba3f @jtrupiano committed Sep 27, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/railtie.rb
View
@@ -4,16 +4,20 @@ class Railtie < Rails::Railtie
module ActionView
class Template
module Handlers
- class TwiML < ::ActionView::Template::Handler
+ class TwiML
+ class_attribute :default_format
self.default_format = 'text/xml'
- include ::ActionView::Template::Handlers::Compilable
def compile(template)
<<-EOS
controller.content_type = 'text/xml'
Twilio::TwiML.build { |res| #{template.source} }
EOS
end
+
+ def self.call(template)
+ new.compile(template)
+ end
end
end
end

0 comments on commit 1527182

Please sign in to comment.