navGATE 0.1.08 → 0.1.09.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/navgate.rb +1 -1
- data/lib/readme.rdoc +17 -16
- data/navGATE.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abaeaa3dc78a47c962d5960c71cfc334d8788a63
|
4
|
+
data.tar.gz: fad4de942712038782d6377748a6982361b8c262
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 337d06a572b0b81a662aa2c514c34ab00394f68920655b13e1b65a9f1dc4beac8060119bb3d70435d760732943d4ec101daa3c522319b85bca77382fba99d7df
|
7
|
+
data.tar.gz: d952047b11e3221e5721d52d64d05b0f6c935e7311cf238ee759149c7d27c99b96661fb3d92528600cc1f955865dc6d85c6488e530c4c1bd819f98cb5a0cdd5e
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rake'
|
|
3
3
|
require 'echoe'
|
4
4
|
|
5
5
|
|
6
|
-
Echoe.new('navGATE','0.1.
|
6
|
+
Echoe.new('navGATE','0.1.09.1') do |p|
|
7
7
|
p.summary = "Allows the easy creation of navigation with config files"
|
8
8
|
p.description = "Can create navigation from objects using the nav builder,from database tables or from a yaml file"
|
9
9
|
p.url = "https://github.com/Thermatix/navGATE"
|
data/lib/navgate.rb
CHANGED
data/lib/readme.rdoc
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
= navGATE
|
2
2
|
|
3
|
-
This gem is provided as is, please read through the
|
3
|
+
This gem is provided as is, please read through the initializer file "build_menu.rb" for examples on how you can use this gem to build a nav menu.
|
4
4
|
|
5
5
|
This gem was built with Rails in mind.
|
6
6
|
|
7
|
-
note: this is my first gem, I am still trying to set it up, so be
|
8
|
-
|
9
|
-
I've tried to to make it easy to install but I'm still not sure how to get those things into the right files automaticly, if some one could point me in the right direction, I'd be happy to make the needed changes.
|
7
|
+
note: this is my first gem, I am still trying to set it up, so be careful when downloading this.
|
8
|
+
|
10
9
|
lastly the gem is up on rubygems.org
|
11
10
|
==Building the menus
|
12
11
|
|
@@ -17,20 +16,20 @@ There are several options you can pass through, if you are building the menu wit
|
|
17
16
|
Also note, you can pass multiple Navgate::builders as you need, just match them to there controllers and they should render properly.
|
18
17
|
===Options
|
19
18
|
|
20
|
-
selection
|
19
|
+
<b>selection</b>: This is used to build the menu options.
|
21
20
|
There are two ways to use this, the first is to use an array of strings containing the menu options a person can select; the second is to pull from a database table, to do this pass a hash with the key being the name of the model and it's value being the field containing it's name
|
22
21
|
|
23
|
-
|
22
|
+
<b>Default</b>: This is used to give the menu a default selection for when the user has not selected anything. Pass a string containing the name of the default selection, if no string is passed then the first item from selection is used.
|
24
23
|
|
25
|
-
prefix
|
24
|
+
<b>prefix</b>: This is used when you have a prefix before the target in the URL, eg: if your links render out as "host.com/books" without a prefix; with a prefix of 'shelf' it will render out as "host.com/shelf/books". This is not for name spacing, for name spacing see the namespace option.
|
26
25
|
|
27
|
-
namespace
|
26
|
+
<b>namespace</b>: This is used for when you have name spacing. It works like prefix however unlike prefix it will also search for the controller within the namespace unlike prefix, which doesn't.
|
28
27
|
|
29
|
-
controller
|
28
|
+
<b>controller</b>: This is used to match the menu to a controller, when deciding which menu to render, it matches this attribute to the current controller. If you have name spacing, the 'namespace' options <em>MUST</em> be used before the 'controller' option otherwise it won't recognize the namespace
|
30
29
|
|
31
|
-
by_id
|
30
|
+
<b>by_id</b>: This is used when you are using a database model to build the menu and you want to link with IDs rather then the selection list. To use it simply set it to true.
|
32
31
|
|
33
|
-
css_class
|
32
|
+
<b>css_class</b>: This is used when you want to hard code the CSS class selector into the menu rather then from the view
|
34
33
|
|
35
34
|
examples:
|
36
35
|
|
@@ -62,7 +61,7 @@ Be sure to pass it as {model_name: :field}
|
|
62
61
|
|
63
62
|
|
64
63
|
=== Using a yml file to build the menu
|
65
|
-
There is also a third option to build the menu, you can use a structured yml file, there is an example yaml file in the config
|
64
|
+
There is also a third option to build the menu, you can use a structured yml file, there is an example yaml file in the config directory called "build_menu.yml".
|
66
65
|
when using this method you are unable to use a database model to create the menu.
|
67
66
|
|
68
67
|
===Building from yaml file,
|
@@ -87,16 +86,18 @@ The yaml file:
|
|
87
86
|
|
88
87
|
==Rendering the menu
|
89
88
|
|
90
|
-
To render the menu use the provided helper
|
89
|
+
To render the menu use the provided helper <tt>render_navigation(options)</tt>;
|
91
90
|
options is a hash that is used to build any html options you might want such as
|
92
|
-
class, it can also take two extra options, 'styling:' and 'wrap:'.
|
91
|
+
'class='some_css_class', it can also take two extra options, 'styling:' and 'wrap:'.
|
93
92
|
|
94
93
|
===Options
|
95
94
|
|
96
|
-
Styling: This is how the navigation can be styled it can either be ':
|
95
|
+
Styling: This is how the navigation can be styled, it can either be ':vertical’ or a character that you wish to use for spacing such as '|' or ':' and so on, it can only be vertical or a spacing character.
|
96
|
+
|
97
97
|
Wrap: This allows you to wrap each link in a html tag, wrap can itself take two differant options, either a string containing the tag's name (without "<>", only the tag name) or an Array containing the tag name and it's class.
|
98
98
|
|
99
99
|
example:
|
100
|
-
render_navigation({:class => "'nav button'", styling: :
|
100
|
+
render_navigation({:class => "'nav button'", styling: :vertical, wrap: ['li','test']}) %>
|
101
101
|
|
102
102
|
note: There is no point in passing a class here if you have one set when you first build the menu, it will just be overridden.
|
103
|
+
|
data/navGATE.gemspec
CHANGED