Class | Haml::Plugin |
In: |
lib/haml/template/plugin.rb
|
Parent: | ActionView::TemplateHandler |
# File lib/haml/template/plugin.rb, line 24 24: def cache_fragment(block, name = {}, options = nil) 25: @view.fragment_for(block, name, options) do 26: eval("_hamlout.buffer", block.binding) 27: end 28: end
# File lib/haml/template/plugin.rb, line 8 8: def compile(template) 9: options = Haml::Template.options.dup 10: 11: # template is a template object in Rails >=2.1.0, 12: # a source string previously 13: if template.respond_to? :source 14: # Template has a generic identifier in Rails >=3.0.0 15: options[:filename] = template.respond_to?(:identifier) ? template.identifier : template.filename 16: source = template.source 17: else 18: source = template 19: end 20: 21: Haml::Engine.new(source, options).send(:precompiled_with_ambles, []) 22: end