lib/ramaze/template/haml.rb in ramaze-0.3.5 vs lib/ramaze/template/haml.rb in ramaze-0.3.9

- old
+ new

@@ -17,17 +17,20 @@ # Transform via Haml templating engine def transform action haml = wrap_compile(action) - haml.to_html(action.instance) + haml.to_html(action.instance, action.binding.locals) end # Instantiates Haml::Engine with the template and haml_options trait from # the controller. def compile(action, template) - ::Haml::Engine.new(template, action.controller.trait[:haml_options] || {}) + opts = action.controller.trait[:haml_options] || {} + opts.merge! :filename => action.template if action.template + + ::Haml::Engine.new(template, opts) end end end end end