0
我已经在我的应用程序中实现了nested_form gem和twitter类型。但是我不能在动态添加的字段中使用这个typeahead。nested_form和twitter typeahead
我的线,其将所述动态线是 <%= ff.link_to_add吨( “add_author”),:book_authors,:数据=> {:目标=> “#authors”}%>
而第一行的键入的JS是:
$(function(){
var authors = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('author'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
limit: 10,
remote: {
url: '/load_suggestions?q=%QUERY',
filter: function(list) {
return $.map(list, function(author) { return {author: book }; });
}
}
});
authors.initialize();
$('#load_suggestions').typeahead({
hint: true,
highlight: true,
minLength: 1
},
{
name: 'authors',
displayKey: 'author',
source: authors.ttAdapter()
});
});
如何修改上述内容以适用于动态添加的行?谢谢
让我试试看,我会回来。非常感谢 – Tiamon 2014-08-29 18:36:47
解决。非常感谢! – Tiamon 2014-08-29 18:56:58
您好,我已经在正常的页面上工作,但它不适用于引导模式。任何建议为模态?谢谢 – Tiamon 2014-09-01 22:38:16