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 +40 -3
- data/cable_menu.gemspec +1 -1
- data/lib/cable_menu/acts_as_cable_menu.rb +1 -1
- metadata +17 -4
data/README
CHANGED
@@ -1,13 +1,50 @@
|
|
1
1
|
CableMenu
|
2
2
|
=========
|
3
3
|
|
4
|
-
|
4
|
+
The modular menu system from Cable.
|
5
5
|
|
6
6
|
|
7
7
|
Example
|
8
8
|
=======
|
9
9
|
|
10
|
-
|
10
|
+
sudo gem install cable_menu
|
11
11
|
|
12
|
+
========================================
|
12
13
|
|
13
|
-
|
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
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
|
-
|
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.
|
73
|
+
rubygems_version: 1.3.7
|
61
74
|
signing_key:
|
62
75
|
specification_version: 3
|
63
76
|
summary: Create cable menus
|