当我使用以下代码覆盖表单编辑时,我在 rails3 中使用 awesome_nested_set 和 activeadmin
form do |f|
f.inputs "Details" do
f.input :parent_category
f.input :url
f.input :map_id, :as => :select, :collection => nested_set_options(Category, @category) {|i| "#{'-' * i.level} #{i.name}" }, :input_html => { :class => 'select2'}
end
f.buttons
end
它就像一个魅力,但是当我尝试对过滤器使用相同的代码时,如下所示:
filter :category, :as =>:select, :collection => nested_set_options(Category, @category) {|i| "#{'-' * i.level} #{i.name}" }, :input_html => { :class => 'select2'}
我收到以下错误:
undefined method `nested_set_options' for #<ActiveAdmin::ResourceDSL:0x007f20c039b0b0>
那么,可能是什么问题?