%= form_with model: @organisation_relationship, url: stock_owners_organisation_path, method: "post", local: true do |f| %> <% if current_user.support? %> <%= render partial: "organisations/headings", locals: { main: @organisation.name, sub: nil } %> <%= render SubNavigationComponent.new(items: secondary_items(request.path, @organisation.id)) %>
Start typing to search for a stock owner
<% else %> <% content_for :before_content do %> <%= govuk_back_link(href: :back) %> <% end %> <%= render partial: "organisations/headings", locals: { main: "What is the name of your stock owner?", sub: nil } %>Start typing to search for your stock owner
<% end %> <% answer_options = { "" => "Select an option" } %> <% @organisations.each do |organisation| %> <% answer_options[organisation[0]] = organisation[1] %> <% end %> <%= render partial: "organisation_relationships/related_organisation_select_question", locals: { field: :parent_organisation_id, question: Form::Question.new("", { "answer_options" => answer_options }, nil), f:, } %> <%= f.govuk_submit "Add" %> <%= govuk_details(summary_text: "Can't find the stock owner you're looking for?") do %>