I can only view the child values in the "show" template using:
<% @guest.plusones.each do |plus| %>
<%= plus.name %>
<%= plus.oldness %>
<% end %>
I now need display these values in a table on the "index" template.
How can I do this?
See tables and relationship below:
Plusone table
+--------------+---------+----------+
| name | Oldness | guest_id |
+--------------+---------+----------+
| Tom Jnr | Child | 4 |
| Nancy Miller | Adult | 5 |
| Ace Flame | Adult | 6 |
+--------------+---------+----------+
Guests table
+----+------------+-----------------+
| id | name | Message |
+----+------------+-----------------+
| 4 | Tom Snr | Congratulations |
| 5 | Rob Miller | Congrats |
| 6 | May Flame | Wow Amazing |
+----+------------+-----------------+
As there anything that I need to add in the GuestController index method?