在typeahead事件上显示模态

时间:2014-12-15 10:26:30

标签: jquery ruby-on-rails

在我的rails应用程序中,我已经实现了typeahead并且到目前为止已经非常出色。我还想要一件事:当用户选择或自动填充建议时,我想要一个模态(我使用bootstrap模态),其中包含要弹出的所选项目的详细信息。

实现typeahead的#code

}).on('typeahead:selected typeahead:autocompleted',
  function(event, data){
    $('.'+event.target.id).val(data.id);
    #Here I would like to call an action in my controller that shows the modal.
  }
});

由于

0 个答案:

没有答案
相关问题