From: Tang Hai Tuan Minh Date: 2004-11-01T18:58:51+09:00 Subject: Re: erb: undefined local variable Thomas Counsell wrote: > Hello > > May just have been the way it arrived in my email message, but ruby > code in erb has to be surrounded by <% and %>. > > So your sample would need to be: > > > Eruby Example > > >

Enumeration

> > > > > Tom Yup, that did the trick... And now, after I reread the relevant page in the PickAxe book (specifically, the page mentioning ) % line of code with the description that "A line that starts with a percent is assumed to contain just Ruby Code" It turns out that vim autoformat my file by adding some additional tabs and so the original code block had tabs before % 5.times do |i| which I believe caused erb to skip it, thereby giving rise to the undefined local variable error message. Hmm... which means that it's much safer to just use the <% Ruby Code %> form from now on :) -- Three minutes' thought would suffice to find this out; but thought is irksome and three minutes is a long time. �����--�A.E.�Houseman