Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/53.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails RailsaToComplete.select not working when option is selected when not working when option is selected through down arrow_Ruby On Rails_Ruby On Rails 3_Autocomplete - Fatal编程技术网

Ruby on rails RailsaToComplete.select not working when option is selected when not working when option is selected through down arrow

Ruby on rails RailsaToComplete.select not working when option is selected when not working when option is selected through down arrow,ruby-on-rails,ruby-on-rails-3,autocomplete,Ruby On Rails,Ruby On Rails 3,Autocomplete,我正在使用rails3 jquery autocomplete来实现自动完成功能,但当我通过鼠标选择时,自动完成会起作用,但如果我通过键盘向下和箭头选择,然后单击“输入”按钮,则它不起作用,我会收到以下代码。我错过了什么 $(".text_field_title").live("focusout",function(){ var name = $(this).attr("name"); var value = $(this).val(); var activity_i

我正在使用rails3 jquery autocomplete来实现自动完成功能,但当我通过鼠标选择时,自动完成会起作用,但如果我通过键盘向下和箭头选择,然后单击“输入”按钮,则它不起作用,我会收到以下代码。我错过了什么

  $(".text_field_title").live("focusout",function(){
    var name = $(this).attr("name");
    var value = $(this).val();
    var activity_id = $(this).attr("rel")
    var practice_plan_id = $(this).attr('practice_plan_id');

    $("#"+activity_id+"_title").bind('railsAutocomplete.select',function(event,data){
      var data = [
        {
          name : name,
          value : value
        },
        {
          name : "activity_id",
          value : activity_id
        },
        {
          name :"fav_id",
          value : data.item.id
        }
      ];

      $.ajax({
        type: 'POST',
        url: 'myurl',
        data: data,
        dataType: "script"
      });

    });
});