我已将 active_admin gem升级到1.4.3,但结果似乎是select2-rails gem损坏了,我得到的错误是:
未捕获的错误:没有select2 / compat / inputData
Ruby: 2.5
Active_admin: 1.4.3
Rails: 4.2.11.1
select2-rails: 3.5.9.1
active_admin.js.coffee
#= require select2
active_admin.css.scss
@import "select2";
//= require select2
宝石文件
gem 'select2-rails','3.5.9.1'
application.css
*= require select2
application.js
//=require select2
sample.js
$(document).ready ( function() {
$(".select2_custom_class").select2({
allowClear: true,
placeholder: 'something',
minimumInputLength: 1,
maximumInputLength: 10,
dropdownAutoWidth: true,
ajax: {
type: 'GET',
url: '',
dataType: 'json',
results: function(val,page){
}
}
})
});