<section id="current-roles">
  <% person.current_roles.each do |role| %>
    <section class="role_appointment role govuk-!-padding-bottom-8">
      <%= render "govuk_publishing_components/components/heading", {
          text: person.current_roles_title,
          id: person.current_roles_title.parameterize,
          margin_bottom: 2,
      } %>

      <%= render "govuk_publishing_components/components/govspeak", {
      } do %>
        <%= role["details"]["body"].html_safe %>
      <% end  %>

      <% if role["document_type"] == "ministerial_role" %>
        <p class="govuk-body-s"><a href=<%= role["base_path"] %>>More about this role</a></p>
      <% end %>

      <% parent_organisations = role["links"]["ordered_parent_organisations"].map { |parent| link_to(parent["title"], parent["base_path"]) }%>
      <%= parent_organisations.to_sentence.html_safe %>
    </section>
  <% end %>
</section>

<section id="current-roles">
  <% person.current_roles.each do |role| %>
    <section class="role_appointment role govuk-!-padding-bottom-8">
      <%= render "govuk_publishing_components/components/heading", {
          text: person.current_roles_title,
          id: person.current_roles_title.parameterize,
          margin_bottom: 2,
      } %>

      <%= render "govuk_publishing_components/components/govspeak", {
      } do %>
        <%= role["details"]["body"].html_safe %>
      <% end  %>

      <% if role["document_type"] == "ministerial_role" %>
        <p class="govuk-body-s"><a href=<%= role["base_path"] %>>More about this role</a></p>
      <% end %>

      <%= role["links"].fetch("ordered_parent_organisations", [])
        .map { |parent| link_to(parent["title"], parent["base_path"]) }
        .to_sentence
        .html_safe %>
    </section>
  <% end %>
</section>

Support a current role without an organisation
Support a current role without an organisation
