Reputation: 3
I have using awesome_nested_set with active_admin. But I found that active_admin can't find nested_set_options method
My active_admin code
ActiveAdmin.register Category do
form do |f|
f.inputs "Category Details" do
f.input :name, :label => "Category name"
f.input :parent_id, :label => "Parent Category", :as => :select, :collection => nested_set_options(Category, @category) {|i| "#{'-' * i.level} #{i.name}" }
end
f.buttons
end
end
Upvotes: 0
Views: 439
Reputation: 2182
try
:as => :select, :collection => f.template.nested_set_options(Category, @category) {|i| "#{'-' * i.level} #{i.name}" }
inside the aa ~ formtastic dsl bridge you can access view helpers from f.template
Upvotes: 2