There is not much documentation in the documentation for Rails templates. It includes handlers such as RJS, ERB, and Builder that offer some help.
I am trying to implement my own, and I succeeded, albeit with a bit of strange code, or perhaps with something that I do not quite understand.
class MyHandler < ActionView::Template::Handler def call(template) template.source.inspect end end
So it is strange that I have to call inspect , otherwise Rails will try to evaluate the string as Ruby code.
I got the impression that this is what include ActionView::...::Compilable (which I do not include in my code).
Now, if I make my template "compiled" (using the include... statement include... ), it is still looking for the call method instead of the compile method.
So can anyone explain me a little more about how this works?
Thanks!
source share