0
I want to apply select2 js with activeadmin using activeadmin_addons gem on has_may through associations but when I apply all the things which are mentioned in gem it looks like select2 js not loading

I have apply all the changes for like what we need to include in js and css files 

when I try to add new record by add more record it gives error like this
 **$(...).select2 is not a function**

活动管理表格:**

form do |f|
    f.semantic_errors *f.object.errors.keys
    f.inputs 'Collection details' do
      f.input :title
      f.input :description
    end
    #f.input :wires, :input_html => { :class => "chosen-input" } # other model with has_many relation ship
    f.inputs 'Wires' do
      f.has_many :collection_wires, allow_destroy: true, new_record: true, heading: false do |collection_wire_f|
        collection_wire_f.input :wire
      end
    end
    f.actions
  end

**

active_admin.js.coffee

#= require active_admin/base
#= require activeadmin_addons/all

当我查看页面源代码时,它显示在代码使用它之前以及在 jquery 和 jquery ujs 之后加载的 select2

当我们在新页面或编辑页面上时,我希望电线应该使用 select2 js 来搜索数据。

请提出任何解决方案

4

2 回答 2

0

我找到了解决方案,当我在开发模式下预编译资产时,js 的路径在开发模式下不起作用,它对我有用。

于 2016-03-01T14:08:05.403 回答
0

我认为这已在此处修复:https ://github.com/platanus/activeadmin_addons/issues/65 并包含在此版本中

于 2016-05-31T21:53:13.303 回答