<h1><%= @diary.title %></h1>

<h4>Entries in this diary</h4>
<% if @diary.entries.any? %>
    <ol>
    <% @diary.entries.each do |e| %>
          <li><%= link_to e.title, user_diary_entry_path(diary_id: @diary, id: e, user_id: @user) %></li>
    <% end %>
    </ol>
<% else %>
    <p>You haven't created any diary entries yet. Why not make a start?<%= link_to %></p>
<% end %>

<%= link_to 'Delete this diary', user_diary_path, method: :delete %>
<%= link_to 'Edit this diary', edit_user_diary_path %>
<%= link_to 'Back to your diaries', user_diaries_path %>

<h1><%= @diary.title %></h1>

<h4>Entries in this diary</h4>
<% if @diary.entries.any? %>
    <ol>
    <% @diary.entries.each do |e| %>
          <li><%= link_to e.title, user_diary_entry_path(diary_id: @diary, id: e, user_id: @user) %></li>
    <% end %>
    </ol>
<% else %>
    <p>You haven't created any diary entries yet. Why not make a start?<%= link_to %></p>
<% end %>

<%= link_to 'Delete this diary', user_diary_path, method: :delete, data: {confirm: 'Are you sure?'} %>
<%= link_to 'Edit this diary', edit_user_diary_path %>
<%= link_to 'Back to your diaries', user_diaries_path %>

Add confirmation to diary delete link
Add confirmation to diary delete link
