<p id="notice"><%= notice %></p>

<h1>Listing Talks</h1>

<table>
  <thead>
    <tr>
      <th>Title</th>
      <th>Description</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @talks.each do |talk| %>
      <tr>
        <td><%= link_to talk.title, talk_url(talk) %></td>
        <td><%= talk.speaker.name %></td>
        <td><%= talk.description %></td>
        <td><%= link_to 'Show', talk %></td>
        <% if current_user %>
          <td><%= link_to 'Edit', edit_talk_path(talk) %></td>
          <td><%= link_to 'Destroy', talk, method: :delete, data: { confirm: 'Are you sure?' } %></td>
        <% end %>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Talk', new_talk_path %>

<p id="notice"><%= notice %></p>

<h1>Listing Talks</h1>

<table>
  <thead>
    <tr>
      <th>Title</th>
      <th>Speaker</th>
      <th>Description</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @talks.each do |talk| %>
      <tr>
        <td><%= link_to talk.title, talk_url(talk) %></td>

        <td>
        <% if talk.speaker %>
          <%= talk.speaker.name %>
        <% end %>
        </td>

        <td><%= talk.description %></td>
        <td><%= link_to 'Show', talk %></td>
        <% if current_user %>
          <td><%= link_to 'Edit', edit_talk_path(talk) %></td>
          <td><%= link_to 'Destroy', talk, method: :delete, data: { confirm: 'Are you sure?' } %></td>
        <% end %>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Talk', new_talk_path %>

Include speaker conditionally so as not to raise error if none is specified
Include speaker conditionally so as not to raise error if none is specified
