<% content_for :head do %>
  <%= stylesheet_link_tag "application", :media => "all" %>
  <%= javascript_include_tag 'application' %>
  <%= csrf_meta_tags %>
<% end %>

<% content_for :page_title, "Specialist Publisher" %>

<% content_for :navbar_items do %>
  <li><%= nav_link_to 'Manuals', '/manuals' %></li>
  <% if user_can_edit_documents? %>
    <li><%= nav_link_to 'Documents', '/specialist-documents' %></li>
  <% end -%>
<% end %>

<% content_for :navbar_right do %>
  Hello, <%= link_to current_user.name, Plek.current.find('signon') %>
  &bull; <%= link_to 'Sign out', gds_sign_out_path %>
<% end %>

<% content_for :content do %>
  <% flash.each do |type, msg| %>
    <%= content_tag :div, msg, class: "alert #{bootstrap_class_for(type)}" %>
  <% end -%>
  <%= render(:partial => 'shared/breadcrumbs') %>
  <%= yield %>
<% end %>
<%= javascript_include_tag "application" %>
<script>
  $(document).ready(function() {
    <%= yield :document_ready %>
  });
</script>
<%# use the govuk_admin_foundation layout %>
<%= render :template => 'layouts/govuk_admin_template' %>


<% content_for :head do %>
  <%= stylesheet_link_tag "application", :media => "all" %>
  <%= javascript_include_tag 'application' %>
  <%= csrf_meta_tags %>
<% end %>

<% content_for :page_title, "Specialist Publisher" %>

<% content_for :navbar_items do %>
  <li><%= nav_link_to 'Manuals', '/manuals' %></li>
  <% if user_can_edit_documents? %>
    <li><%= nav_link_to 'Documents', '/specialist-documents' %></li>
  <% end -%>
<% end %>

<% content_for :navbar_right do %>
  Hello, <%= link_to current_user.name, Plek.current.find('signon') %>
  &bull; <%= link_to 'Sign out', gds_sign_out_path %>
<% end %>

<% content_for :content do %>
  <% flash.each do |type, msg| %>
    <%= content_tag :div, msg, class: "alert #{bootstrap_class_for(type)}" %>
  <% end -%>
  <%= render(:partial => 'shared/breadcrumbs') %>
  <%= yield %>
  <script>
    $(document).ready(function() {
      <%= yield :document_ready %>
    });
  </script>
<% end %>

<%# use the govuk_admin_foundation layout %>
<%= render :template => 'layouts/govuk_admin_template' %>


Stop JS from rendering outside of head tag
Stop JS from rendering outside of head tag

When I moved to the govuk_admin_template I accidentally left some things outside of content_for tags which meant that there were a whole bunch of script tags at the top of the page before the <head> this caused ie^ and 7 to get very confused, naturally.
