The issue is that Haml::Helpers, which is included in the scope object, 
redefines "puts" as a Haml helper method. In retrospect, this was 
probably a stupid thing to name the helper method, and will likely be 
changed in the future. For now, though, if you call Kernel.puts 
explicitly you should be fine.

fred wrote:
> I tried to call render method from Haml::Engine, passing the scope as
> an Object and I get an error
>
> /Library/Ruby/Gems/1.8/gems/haml-2.0.2/lib/haml/helpers.rb:262:in
> `puts': undefined method `buffer' for nil:NilClass (NoMethodError)
>
> But if I pass string as the scope it will be fine.
>
> e.g
>
> class QuickRenderer
>
> def version
> @version ||= 1
> end
>
> def out
> puts Haml::Engine.new("%p= version").render(self)
> end
>
> end
>
>
> I was expecting that the template scope will be the QuickRenderer
> instance itself by passing "self" as the scope.
> I tried with
>
> Haml::Engine.new("%p= version").render(binding)
>
> doesn't work as well. Any idea?
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to