cable_menu 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,13 +1,50 @@
1
1
  CableMenu
2
2
  =========
3
3
 
4
- Introduction goes here.
4
+ The modular menu system from Cable.
5
5
 
6
6
 
7
7
  Example
8
8
  =======
9
9
 
10
- Example goes here.
10
+ sudo gem install cable_menu
11
11
 
12
+ ========================================
12
13
 
13
- Copyright (c) 2010 [name of plugin creator], released under the MIT license
14
+ script/generate cable_menu your_menu_name
15
+ script/generate model Page title:string
16
+ rake db:migrate
17
+
18
+ =========================================
19
+
20
+ #environment.rb
21
+ gem.config "acts_as_tree"
22
+ gem.config "cable_menu"
23
+
24
+ #page.rb
25
+ class Page < ActiveRecord::Base
26
+ acts_as_cable
27
+ end
28
+
29
+ #your_menu_name.rb
30
+ class YourMenuName < ActiveRecord::Base
31
+ acts_as_cable_menu
32
+ end
33
+
34
+ =========================================
35
+
36
+ script/console
37
+ >> p = Page.new :title => "About Us"
38
+ => #<Page id: nil, title: "About Us", created_at: nil, updated_at: nil>
39
+ >> p.build_menu :title => "About Us", :url => "about_us"
40
+ => #<Menu id: nil, title: "About Us", cable_menuable_id: nil, cable_menuable_type: "Page", parent_id: nil, url: "about_us", created_at: nil, updated_at: nil>
41
+ >> p.save
42
+ => true
43
+ >> p.menu.url
44
+ => "about_us"
45
+ >> p.menu.resource
46
+ => #<Page id: 2, title: "About Us", created_at: "2010-08-29 07:36:23", updated_at: "2010-08-29 07:36:23">
47
+
48
+
49
+
50
+ Copyright (c) 2010 The Able Few, LLC, released under the MIT license
data/cable_menu.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{cable_menu}
3
- s.version = "0.0.1"
3
+ s.version = "0.0.2"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Spencer Markowski | The Able Few"]
@@ -8,7 +8,7 @@ module CableMenu
8
8
  def acts_as_cable_menu
9
9
  send :include, InstanceMethods
10
10
  belongs_to :cable_menuable, :polymorphic => true
11
- acts_as_tree
11
+ acts_as_nested_set
12
12
  end
13
13
  end
14
14
 
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cable_menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
5
11
  platform: ruby
6
12
  authors:
7
13
  - Spencer Markowski | The Able Few
@@ -43,21 +49,28 @@ rdoc_options: []
43
49
  require_paths:
44
50
  - lib
45
51
  required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
46
53
  requirements:
47
54
  - - ">="
48
55
  - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
49
59
  version: "0"
50
- version:
51
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
52
62
  requirements:
53
63
  - - ">="
54
64
  - !ruby/object:Gem::Version
65
+ hash: 11
66
+ segments:
67
+ - 1
68
+ - 2
55
69
  version: "1.2"
56
- version:
57
70
  requirements: []
58
71
 
59
72
  rubyforge_project: cable_menu
60
- rubygems_version: 1.3.5
73
+ rubygems_version: 1.3.7
61
74
  signing_key:
62
75
  specification_version: 3
63
76
  summary: Create cable menus