我想使用 activeadmin_addons gem 将 select2 js 与 activeadmin 一起应用
I want to apply select2 js with activeadmin using activeadmin_addons gem
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 来搜索数据。
请提出任何解决方案
我找到了解决方案,当我在开发模式下预编译资产时,js 的路径在开发模式下不起作用,它对我有用。
我认为这已在此处修复:https://github.com/platanus/activeadmin_addons/issues/65
并包含在 this release
中
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 来搜索数据。
请提出任何解决方案
我找到了解决方案,当我在开发模式下预编译资产时,js 的路径在开发模式下不起作用,它对我有用。
我认为这已在此处修复:https://github.com/platanus/activeadmin_addons/issues/65 并包含在 this release
中