Created
January 19, 2012 21:44
-
-
Save formigarafa/1642969 to your computer and use it in GitHub Desktop.
Nested categories with Active Admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveAdmin.register Category do | |
extend CollectiveIdea::Acts::NestedSet::Helper | |
form do |f| | |
f.inputs do | |
f.input :name | |
f.input :parent_id, :as => :select, :collection => (nested_set_options(Category, @category) {|i, level| "#{'-' * level} #{i.name}" }) | |
end | |
f.buttons | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This didn't work for me. I had to use