% content_for :title, "Add a location to this scheme" %> <% content_for :before_content do %> <%= govuk_back_link( text: "Back", href: if params[:referrer] == "check_answers" scheme_location_check_answers_path(@scheme, @location) else params[:referrer] == "details" ? scheme_location_path(@scheme, @location) : scheme_location_postcode_path(@scheme, @location) end, ) %> <% end %> <%= form_for(@location, method: :patch, url: scheme_location_name_path(@scheme, @location, referrer: params[:referrer])) do |f| %>