You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: archival_objects_controller.rb
    path of file: ./repos/archivesspace/frontend/app/controllers
    
    the code of the file until where you have to start completion: class ArchivalObjectsController < ApplicationController

  set_access_control  "view_repository" => [:index, :show, :models_in_graph],
                      "update_resource_record" => [:new, :edit, :create, :update, :transfer, :rde, :add_children, :publish, :unpublish, :accept_children, :validate_rows],
                      "suppress_archival_record" => [:suppress, :unsuppress],
                      "delete_archival_record" => [:delete],
                      "manage_repository" => [:defaults, :update_defaults]

  def new
    @archival_object = ArchivalObject.new._always_valid!
    @archival_obje
    
  def add_children
    @parent = JSONModel(:archival_object).find(params[:id])
    @resource_uri = @parent['resource']['ref']

    if params[:archival_record_children].blank? or params[:archival_record_children]["children"].blank?

      @children = ArchivalObjectChildren.new
      flash.now[:error] = I18n.t("rde.messages.no_rows")

    else
      children_data = cleanup_params_for_schema(params[:archival_record_children], JSONModel(:archival_record_children).schema)

      begin
        @children = ArchivalObjectChildren.from_hash(children_data, false)

        if params["validate_only"] == "true"
          @exceptions = @children.children.collect {|c| JSONModel(:archival_object).from_hash(c, false)._exceptions}

          error_count = @exceptions.select {|e| !e.empty?}.length
          if error_count > 0
            flash.now[:error] = I18n.t("rde.messages.rows_with_errors", :count => error_count)
          else
            flash.now[:success] = I18n.t("rde.messages.rows_no_errors")
          end