title: Implementing Rails 3 template handlers
body: <p>It appears there's not much documentation on Rails template handlers. There's the included handlers, like RJS, ERB, and Builder, which offer some assistance.</p>
  
  <p>I'm trying to implement my own, and I've succeeded, albeit with a bit of weird code, or possibly there's something I don't quite understand.</p>
  
  <pre><code>class MyHandler &lt; ActionView::Template::Handler
    def call(template)
      template.source.inspect
    end
  end
  </code></pre>
  
  <p>So what's weird is that I have to call <code>inspect</code>, otherwise Rails will try to eval the string as Ruby code.</p>
  
  <p>I was under the impression that that's what <code>include ActionView::...::Compilable</code> did (which I'm not including in my code).</p>
  
  <p>Now, if I make my template "compilable" (by using the <code>include...</code> statement), it still looks for the <code>call</code> method instead of the <code>compile</code> method.</p>
  
  <p>So could anyone explain to me a bit more about how this works?</p>
  
  <p>Thanks!</p>