-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
69 lines (48 loc) · 1.52 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ActsAsTaggedTree
================
== Introduction
ActsAsTaggedTree creates and maintains a tree where the following structure exists:
root -+
|
+ Tag1+
| |
| + node1
| + node2
+ Tag2+
| |
| + node3
+ Tag3+
|
+ node1
+ node3
Note that nodes can exist in more than one tag.
== Requirements
ActsAsTaggedTree requires the following gems/plugins:
acts_as_tree
acts_as_taggable_on[_steroids]
It will work with either acts_as_taggable_on or acts_as_taggable_on_steroids
== Installation
rails plugin install git://github.com/viglesias/acts_as_tagged_tree
== Usage
=== Prepare database
Generate and apply the migration:
ruby script/generate acts_as_tagged_tree_migration
rake db:migrate
=== Modify your tagged model
Within your tagged model add
acts_as_tagged_tree [:label => :property]
:property is an optional property which is used as the label of a node
in the tree. By default it is name
Example
=======
class Post < ActiveRecord::Base
acts_as_taggable
acts_as_tagged_tree :label => :title
end
Optionally you can add a :treemap => true to the arguments of the
acts_as_tagged_tree call and it will add the ability of
acts_as_treemap to the tagged tree. Bear in mind you'll have to
install acts_as_treemap if you do so. You can optionally add size and
color methods to your Model to adjust the size and color of the node
in a treemap.
Copyright (c) 2008 [name of plugin creator], released under the MIT license