Created
December 21, 2012 05:51
-
-
Save takuyan/4350910 to your computer and use it in GitHub Desktop.
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
# Create a root node: | |
science = Category.create!(name: 'Science') | |
# Put a new thing inside this root node: | |
physics = Category.create!(name: 'Physics') | |
physics.move_to_child_of(science) | |
# Put another thing inside the "physics" node: | |
gravity = Category.create!(name: 'Gravity') | |
gravity.move_to_child_of(physics) | |
# Reload the root node: | |
science.reload | |
# Now you should have something that resembles this: | |
# science | |
# '-- physics | |
# '-- gravity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment