2016-03-01 15 views
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** 

主動聯繫方式: **我想用activeadmin_addons寶石與activeadmin申請選擇2 JS

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來搜索數據,當我們在新的或編輯頁面。

請提出解決方案

回答

0

我已經找到了解決辦法有問題,與不發展模式工作的js的路徑時,我預編譯它爲我工作在發展模式的資產。