ActiveAdmin升级中断了select2-rails:没有select2 / compat / inputData

时间:2019-05-14 07:04:00

标签: ruby-on-rails activeadmin select2-rails

我已将 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

附加错误的屏幕截图:enter image description here

  

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){
            }
        }
  })
});

0 个答案:

没有答案