A legs table seems more flexible, however:

<tr>
 <% (1..36).each do |p| %>
     <td>Leg <%= @race.send(('leg' + p).to_sym) %></td>
 <% end %>
</tr>

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 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
> > race and iterate through them with @legs.each
>
> > So long
> > Lennart Koopmann
>
> Lennart...interesting thought, problem is I'll still have the default
> fields I have to deal with (created_at,updated_at, race_id)so it
> wouldn't be a purely 'leg' table. I could filter that out I guess but I
> want to try to make this work.
> Thanks for the reply
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to