<p>back to <%= link_to 'documents', documents_path %></p>

<div class="document_view">
  <h1 class="title"><%= @published_edition.title %></h1>
  <div class="body">
    <%= govspeak_to_html @published_edition.body %>
  </div>
  <p class="attachment"><%= link_to_attachment(@published_edition.attachment) %></p>
  <p class="written_by">Written by <span class="author"><%= @published_edition.author.name %></span></p>
</div>

<% if @published_edition.topics.any? %>
  <section id="topics">
    <h1>Topics</h1>
    <ul class="topics">
    <% @published_edition.topics.each do |topic| %>
      <li class="topic"><%= link_to topic.name, topic_path(topic) %></li>
    <% end %>
    </ul>
  </section>
<% end %>

<% if @published_edition.organisations.any? %>
  <section id="organisations">
    <h1>Topics</h1>
    <ul class="organisations">
    <% @published_edition.organisations.each do |topic| %>
      <li class="organisation"><%= link_to organisation.name, topic_path(organisation) %></li>
    <% end %>
    </ul>
  </section>
<% end %>
<p>back to <%= link_to 'documents', documents_path %></p>

<div class="document_view">
  <h1 class="title"><%= @published_edition.title %></h1>
  <div class="body">
    <%= govspeak_to_html @published_edition.body %>
  </div>
  <p class="attachment"><%= link_to_attachment(@published_edition.attachment) %></p>
  <p class="written_by">Written by <span class="author"><%= @published_edition.author.name %></span></p>
</div>

<% if @published_edition.topics.any? %>
  <section id="topics">
    <h1>Topics</h1>
    <ul class="topics">
    <% @published_edition.topics.each do |topic| %>
      <%= content_tag_for :li, topic do %>
        <%= link_to topic.name, topic_path(topic) %>
      <% end %>
    <% end %>
    </ul>
  </section>
<% end %>

<% if @published_edition.organisations.any? %>
  <section id="organisations">
    <h1>Topics</h1>
    <ul class="organisations">
    <% @published_edition.organisations.each do |topic| %>
      <%= content_tag_for :li, organisation do %>
        <%= link_to organisation.name, organisation_path(organisation) %>
      <% end %>
    <% end %>
    </ul>
  </section>
<% end %>
Use content_tag_for to show records
Use content_tag_for to show records
