From: John Joyce Date: 2007-07-14T01:10:22+09:00 Subject: Re: ERb with nested loops-- NG! On Jul 13, 2007, at 3:25 AM, Jano Svitok wrote: > On 7/13/07, John Joyce wrote: >> How do you do nested loops in ERb? >> Is it possible? >> Every time I attempt it, ERb barfs. > > I see no problem there. Could you post your attempt to see what's > wrong? > >> Oh, and how can you require a .rb file and use its methods in ERb >> files? >> Does the require line need to be in the erb.cgi file? > > I think 'require' can be put anywhere. It always 'require's to the top > level context. > > J. > Actually could anyone post some examples of ERb for web pages, but non-Rails? Particularly I'd like to look at the requires and how nested loops are handled, but more to the point, I'm wondering if the cgi file that calls Ruby is part of the problem. Cgi is a big mystery to me. Every text goes over it quickly and assumes you know it from Perl.