Hi Paul,
can you give the information of how your @user.run looks like
basically i need the output of @user.run.inspect
Note:
just try using <%= step.start_time.blank? ? "-" : step.start_time
%>
instead of <%= step.start_time %>
On Aug 21, 1:53 pm, Paul Nichols
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I have two tables - runs and steps. Each run has many steps, each step
> has one run.
>
> The output i''d like:
>
> Description         Run1      Run2
> Start               13.00     14.35
> Run application     13.01     14.48
> Process stuff           -     14.49
> End application     13.05     14.51
> Close               13.06     -
> Clear down              -     14.58
>
> The output i get:
>
> Description         Run1      Run2
> Start               13.00     14.35
> Run application     13.01     14.48
> Process stuff       13.05     14.49
> End application     13.06     14.51
> Close                   -     14.58
> Clear down              -     -
>
> The problem being some runs don''t share the same steps.
>
> The code in my view is as follows:
>
> Description column (@user just gets the current user''s runs):
>
> <% @user.runs.each_with_index do |run, i| %>
>   <% if i == 0 %>
>     <% for step in run.steps %>
>       <tr>
>         <td width=250 align=right>
>           <b><%=h step.description %> </b>
>         </td>
>       </tr>
>     <% end %>
>   <% end %>
> <% end %>
>
> Run columns:
>
> <% for run in @user.runs %>
>   <% for step in run.steps %>
>     <tr>
>       <td width=250 class=compareleft>
>         <%= step.start_time %>
>       </td>
>     </tr>
>   <% end %>
> <% end %>
>
> Clearly i need some logic here to arrange the
''start_time'' data in the
> correct row. Can anyone suggest how i can go about this?
> --
> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---