I'm currently learning about Ruby on Rails, following this particular tutorial https://www.youtube.com/watch?v=fmyvWz5TUWg&t=2625s
After execute the command rails g scaffold friends name:string email:string phone:string followed by rails db:migrate I ended up with a CRUD structure to that simple friend model (name, email and phone all strings).
Everything is good and all works fine except when i go to http://localhost:3000/friends and the list of friends is showed in a weird way! I was expecting a table where witch row is an friend, instead of that i end up with a vertical structure where each friend is displayed vertically...
index.html.erb
<p style="color: green"><%= notice %></p>
<h1>Friends</h1>
<div id="friends">
<% @friends.each do |friend| %>
<%= render friend %>
<p>
<%= link_to "Show this friend", friend %>
</p>
<% end %>
</div>
<%= link_to "New friend", new_friend_path %>
_friend.html.erb
<div id="<%= dom_id friend %>">
<p>
<strong>Name:</strong>
<%= friend.name %>
</p>
<p>
<strong>Email:</strong>
<%= friend.email %>
</p>
<p>
<strong>Phone:</strong>
<%= friend.phone %>
</p>
</div>
I believe that i have something with wrong configuration but can't find out what.
All source code: https://github.com/Paul-Bob/RailsFriends
