Sha256: 69647cff1ed6a1c90b61fad861ac4b5d1cbad9c4a78cb43f58d8aa9825fad2c9
Contents?: true
Size: 783 Bytes
Versions: 7
Compression:
Stored size: 783 Bytes
Contents
# encoding: utf-8 require "tilt" module TemplateInheritance module TiltExtensions # Tilt::HamlTemplate.options[:default_attributes] = {script: {type: "text/javascript"}, form: {method: "POST"}} module Haml def self.included(klass) klass.send(:remove_method, :initialize_engine) def klass.options @options ||= Hash.new end end def initialize_engine require_template_library 'haml' unless defined? ::Haml::Engine require "template-inheritance/exts/haml" if self.class.options[:default_attributes] end def initialize(*args) super self.options.merge!(self.class.options) end end end end Tilt::HamlTemplate.send(:include, TemplateInheritance::TiltExtensions::Haml)
Version data entries
7 entries across 7 versions & 1 rubygems