Sha256: ce6896cab0848b5f086efe433f5cd0627025ad2d1f9ce190b85d6216030708cb
Contents?: true
Size: 814 Bytes
Versions: 19
Compression:
Stored size: 814 Bytes
Contents
require 'safemode' require 'haml/safemode' module ActionView module TemplateHandlers class SafeHaml < TemplateHandler include Compilable rescue nil # does not exist prior Rails 2.1 extend SafemodeHandler def self.line_offset 3 end def compile(template) # Rails 2.0 passes the template source, while Rails 2.1 passes the # template instance src = template.respond_to?(:source) ? template.source : template filename = template.filename rescue nil options = Haml::Template.options.dup haml = Haml::Engine.new template, options methods = delegate_methods + ActionController::Routing::Routes.named_routes.helpers haml.precompile_for_safemode filename, ignore_assigns, methods end end end end
Version data entries
19 entries across 19 versions & 1 rubygems