1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/haml/template/plugin.rb
nex3 7f1593aea0 Actually add compatibility with edge rails (I hope).
git-svn-id: svn://hamptoncatlin.com/haml/trunk@731 7063305b-7217-0410-af8c-cdc13e5119b9
2008-01-23 17:04:34 +00:00

29 lines
629 B
Ruby

# :stopdoc:
# This file makes Haml work with Rails
# using the > 2.0.1 template handler API.
module Haml
class Template
include ActionView::TemplateHandlers::Compilable if defined?(ActionView::TemplateHandlers::Compilable)
def self.line_offset
1
end
def line_offset
self.class.line_offset
end
def initialize(view)
@view = view
end
def compile(template)
options = Haml::Template.options.dup
Haml::Engine.new(template, options).send(:precompiled_with_ambles, [])
end
end
end
ActionView::Base.register_template_handler(:haml, Haml::Template)
# :startdoc: