From: Alvaro Bautista Date: 2008-02-13T19:59:56+09:00 Subject: Re: ERB: import function Jano Svitok wrote: > This is halfway to solution: > > def import path > ERB.new(File.read(path), nil, nil, '_x_').result() > end > > Notice the other parameters, especially the last one. ERB uses one > variable to store the output. If you don't specify any, > it will use a default one - and each nested ERB will overwrite the new > one. The solution is 1. use another name for each nested import > 2. use another binding for each nested import (i.e. make another > scope, and let ERB create another var with the same name > in the new scope/binding, leaving the ability to return to the previous > one) I use the last parameter to put the output in a variable an it works. Thank you. -- Posted via http://www.ruby-forum.com/.