From: Gaspard Bucher Date: 2008-03-14T16:55:00+09:00 Subject: Re: erb recursion Here is a small test file with these two solutions. As you can see from running the file, the "lambda" solution does not work. The "method definition" works fine (but I loose all the local variables in the definition. http://pastie.caboo.se/165584 Another solution would be to capture binding before method definition and pass it inside the method (but this looks a lot like a block. To the clever minds out there: is there a way to fix the first "lambda" solution ? <% a = lambda do |var| %><<%= var.name %>> <% var.children.each do |var2| %><%= a.call(var2) %><% end %>> <% end %> ------------- <% a.call(data) %> ( see pastie above for data format ) Gaspard