app/views/entries/_entry.html.erb
<% content_for :header do %>
<%= render partial: "date",
object: entry.date,
locals: { today: entry.for_today? }
%>
<% end %>
<p>
<%= link_to "Edit this entry", edit_entry_path(entry) %>
</p>
<%= paginate @entries %>
<%= simple_format(entry.body) %>
<% if entry.photo.url %>
<%= image_tag entry.photo.url, width: 400 %>
<% end %>