<%= form_for [:admin, topic] do |topic_form| %>
  <%= topic_form.errors %>

  <fieldset>
    <%= topic_form.text_field :name %>
    <%= topic_form.text_area :description %>
  </fieldset>

  <fieldset>
    <h1>Policy ordering</h1>
    <%= topic_form.fields_for :document_topics do |document_topic_form| %>
      <% if document_topic_form.object.document.is_a?(Policy) %>
        <%= document_topic_form.text_field :ordering, label_text: link_to(document_topic_form.object.document.title, admin_document_path(document_topic_form.object.document)) %></p>
      <% end %>
    <% end %>
  </fieldset>

  <%= topic_form.save_or_cancel cancel: admin_topics_path %>
<% end %>
<%= form_for [:admin, topic] do |topic_form| %>
  <%= topic_form.errors %>

  <fieldset>
    <%= topic_form.text_field :name %>
    <%= topic_form.text_area :description %>
  </fieldset>

  <fieldset>
    <legend>Policy ordering</legend>
    <%= topic_form.fields_for :document_topics do |document_topic_form| %>
      <% if document_topic_form.object.document.is_a?(Policy) %>
        <%= document_topic_form.text_field :ordering, label_text: link_to(document_topic_form.object.document.title, admin_document_path(document_topic_form.object.document)) %></p>
      <% end %>
    <% end %>
  </fieldset>

  <%= topic_form.save_or_cancel cancel: admin_topics_path %>
<% end %>
Use a legend, not a heading.
Use a legend, not a heading.
