def permit_params(*args, &block)
      param_key = config.param_key.to_sym
      belongs_to_param = config.belongs_to_param
      create_another_param = :create_another if config.create_another

      controller do
        define_method :permitted_params do
          permitted_params =
            active_admin_namespace.permitted_params +
              Array.wrap(belongs_to_param) +
              Array.wrap(create_another_param)

          params.permit(*permitted_params, param_key => block ? instance_exec(&block) : args)
        end

        private :permitted_params
      end
    end
def permit_params(*args, &block)
      param_key = config.param_key.to_sym
      belongs_to_param = config.belongs_to_param
      create_another_param = :create_another if config.create_another

      controller do
        define_method :permitted_params do
          permitted_params =
            active_admin_namespace.permitted_params +
              Array.wrap(belongs_to_param) +
              Array.wrap(create_another_param)

          params.permit(*permitted_params, param_key => block ? instance_exec(&block) : args)
        end

        private :permitted_params
      end
    end
Keys included in the `permitted_params` setting are automatically whitelisted.

 Either

   permit_params :title, :author, :body, tags: []

 Or

   permit_params do
     defaults = [:title, :body]
     if current_user.admin?
       defaults + [:author]
     else
       defaults
     end
   end