Skip to content

Instantly share code, notes, and snippets.

@dwaynemac
Created August 31, 2010 13:42
Show Gist options
  • Save dwaynemac/559033 to your computer and use it in GitHub Desktop.
Save dwaynemac/559033 to your computer and use it in GitHub Desktop.
Achieven nested tags
config.gem "acts-as-taggable-on", :source => "http://gemcutter.org", :version => '2.0.0.rc1'
./script/generate acts_as_taggable_on_migration
./script/plugin install http://github.com/rails/acts_as_tree.git
class NestedTags < ActiveRecord::Migration
def self.up
add_column :tags, :parent_id, :integer
end
def self.down
remove_column :tags, :parent_id
end
end
./script/generate migration nested_tags
class Tag < ActiveRecord::Base
acts_as_tree
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment