Class: RubyTemplate

Inherits:
ActionView::TemplateHandler
  • Object
show all
Includes:
ActionView::TemplateHandlers::Compilable
Defined in:
lib/rails_ext/action_view/ruby_template.rb

Overview

Usage: ActionView::Template.register_template_handler :rb, RubyTemplate

Instance Method Summary collapse

Instance Method Details

#compile(template) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rails_ext/action_view/ruby_template.rb', line 6

def compile(template)
  # "_set_controller_content_type(Mime::XML);" +
  # "xml = ::Builder::XmlMarkup.new(:indent => 2);" +
  # "self.output_buffer = xml.target!;" +
  "self.output_buffer = '';\n" + template.source
  # ";xml.target!;"
end