I am learning a rails on YouTube and here I am having issues with table style. The video is old and rails are update already. However, I am following exactly what he is doing in the video, but I ended up with this weird looking table of friends list.
I want to put all friends info next to each other up-and-down like the video.
CodePudding user response:
I think you want something like this.
<table >
<thead >
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Phone</th>
<th>Email</th>
<th>Twitter</th>
</tr>
</thead>
<tbody>
<% @friends.each do |friend| %>
<tr>
<td><%= friend.firstname %></td>
<td><%= friend.lastname %></td>
<td><%= friend.phone %></td>
<td><%= friend.email %></td>
<td><%= friend.twitter %></td>
</tr>
<% end %>
</tbody>
</table>