Autocomplete not working.. 404

but the policy function is called ’ canGetAjaxList’ so the authorize argument checks if this user is allowed to get ajax lists…

ok i will check that later because im not that familiar with policies yet! the given policy for articles from the tutorial was simple but for users it seems to be different…

well, i tried to request the profile.name with almost the same code that i used before but this is not working:

Index.php

<?= $this->Form->control('**profile.name**', ['type' => 'text', 'autocomplete' => 'off']); ?>

Javascript:
$(document).ready(function(){

jQuery('#profile-name').autocomplete({
    source:'<?= $this->Url->build([ "controller" => "Users", "action" => "getAjax-list"],["fullBase" => true,]); ?>',
    minLength: 2,
    delay:0,
    select: function(event, ui) {
            event.preventDefault();
            $("profile.name").val(ui.item.label);
    },


    focus: function(event, ui) {
            event.preventDefault();
            $("#profile.name").val(ui.item.label);
    }
});

});

UserController:

public function getAjaxList()
{
$this->autoRender = false;

if ($this->request->is('ajax')) {
    
     ]);
    
    $this->Authorization->skipAuthorization();      
    $name = $this->request->getQuery('term');
    $results = $this->Users->find('all', [
        **'contain' => ['Profiles'],**            '
         **conditions' => ['profile.name LIKE' => $name . '%'],**
        'limit' => 10,
        
        **'fields'=>['id','profile.name']**
    ]);
    //debug($results);

What he says now is:

  1. {message: “SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘profile.name’ in ‘field list’”,…}

  2. code: 500

  3. file: “/var/www/html/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php”

  4. line: 39

  5. message: “SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘profile.name’ in ‘field list’”

  6. url: “/users/get-ajax-list?term=test”