From: Nathan Standiford Date: 2012-06-20T01:31:44+09:00 Subject: Re: Does ERB have recursive template support? I am currently using ERB for code generation. I implemented this using a xml document schema of my own creation and chose not to do the recursive template approach due to elegance. It strongly depends on your use case, but I planned on dynamically loading many different ruby source files containing an ERB template and it's template variables. Nesting templates would have been quite ugly for me, since there could potentially be hundreds of exceptions. -----Original Message----- From: Robert Klemme [mailto:shortcutter@googlemail.com] Sent: Tuesday, June 19, 2012 1:26 AM To: ruby-talk ML Subject: Re: Does ERB have recursive template support? On Tue, Jun 19, 2012 at 5:26 AM, Todd Wei wrote: > I want to use ERB template library to do some code generation. It > requires generating nested structures, so I need recursive template > support. As I know, Rails does have recursive template support, but I > can't find it in ERB document. > > Could someone confirm if there's recursive template support in the > standard ERB template library? Thanks a lot! What exactly do you mean by "recursive templates"? Do you mean a template which can present recursive structures such as trees? Or do you want an ERB template to include itself? Both should be doable since you can invoke arbitrary code. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/