[Rails] Re: Iterate through a table record

2008-11-21 Thread Bill McGuire
Harold wrote: > A legs table seems more flexible, however: > > > <% (1..36).each do |p| %> > Leg <%= @race.send(('leg' + p).to_sym) %> > <% end %> > > > On Nov 21, 5:59�pm, Bill McGuire <[EMAIL PROTECTED]> Harold...worked just like I wanted. The only thing I had to do was add '.to_s'

[Rails] Re: Iterate through a table record

2008-11-21 Thread Harold
A legs table seems more flexible, however: <% (1..36).each do |p| %> Leg <%= @race.send(('leg' + p).to_sym) %> <% end %> On Nov 21, 5:59 pm, Bill McGuire <[EMAIL PROTECTED]> wrote: > Lennart Koopmann wrote: > > 2008/11/21 Bill Mcguire <[EMAIL PROTECTED]> > > >> Is there a way to increme

[Rails] Re: Iterate through a table record

2008-11-21 Thread Bill McGuire
Lennart Koopmann wrote: > 2008/11/21 Bill Mcguire <[EMAIL PROTECTED]> > >> Is there a way to increment @race.leg so I don't have to write >> @race.leg1 [EMAIL PROTECTED] ? >> > > Can you change the database structure? I think it would make more sense > to > have a "legs" table in this case. Th

[Rails] Re: Iterate through a table record

2008-11-21 Thread Lennart Koopmann
2008/11/21 Bill Mcguire <[EMAIL PROTECTED]> > Is there a way to increment @race.leg so I don't have to write > @race.leg1 [EMAIL PROTECTED] ? > Can you change the database structure? I think it would make more sense to have a "legs" table in this case. Then you could lookup all legs of a given r