<% role_type = role.type %>
<%= form_for [:admin, role.becomes(Role)], as: :role do |form| %>
  <%= form.errors %>

  <fieldset>
    <%= form.text_field :name %>
    <%= form.label :type %>
    <%= form.select :type, grouped_options_for_select(role_type_options, role_type_option_value_for(role, role_type)) %>
    <%= form.label :organisation_ids, 'Organisations' %>
    <%= form.select :organisation_ids, options_from_collection_for_select(Organisation.all, 'id', 'name', role.organisation_ids), {}, multiple: true, class: 'chzn-select', data: { placeholder: "Choose organisations..." } %>
  </fieldset>

  <fieldset>
    <%= form.text_area :responsibilities, class: "previewable" %>
  </fieldset>

  <%= form.save_or_cancel cancel: admin_roles_path %>
<% end %>

<% role_type = role.type %>
<%= form_for [:admin, role.becomes(Role)], as: :role do |form| %>
  <%= form.errors %>

  <fieldset>
    <%= form.text_field :name %>
    <%= form.label :type %>
    <%= form.select :type, grouped_options_for_select(role_type_options, role_type_option_value_for(role, role_type)) %>
    <%= form.label :organisation_ids, 'Organisations' %>
    <%= form.select :organisation_ids, options_from_collection_for_select(Organisation.all, 'id', 'name', role.organisation_ids), {}, multiple: true, class: 'chzn-select', data: { placeholder: "Choose organisations..." } %>
    <%= form.label :worldwide_office_ids, 'Worldwide offices' %>
    <%= form.select :worldwide_office_ids, options_from_collection_for_select(WorldwideOffice.all, 'id', 'name', role.worldwide_office_ids), {}, multiple: true, class: 'chzn-select', data: { placeholder: "Choose worldwide offices..." } %>
  </fieldset>

  <fieldset>
    <%= form.text_area :responsibilities, class: "previewable" %>
  </fieldset>

  <%= form.save_or_cancel cancel: admin_roles_path %>
<% end %>

Update roles form to associate worldwide offices
Update roles form to associate worldwide offices
