Re: Trying to show 3 tables in 1 view

23 views
Skip to first unread message

Lorenz Blackbird

unread,
Feb 15, 2013, 4:52:44 AM2/15/13
to rubyonra...@googlegroups.com
In the index view of team write the code of index view of player and
select only the team players by @team.player:

<table>
<tr>
<th>Name</th>
<th>Position</th>
<th>Number</th>
</tr>
<% @team.players.each do |team_player| %>
<tr>
<td><%= team_player.first_name %> <%= team_player.last_name
%></td>
<td><%= team_player.position %></td>
<td><%= team_player.number %></td>
</tr>
<% end %>
</table>

For the results it's he same.

--
Posted via http://www.ruby-forum.com/.

Jax

unread,
Feb 16, 2013, 7:14:38 AM2/16/13
to rubyonra...@googlegroups.com
It worked a treat! thanks a million!

Jax
Reply all
Reply to author
Forward
0 new messages