menu_builder 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +10 -90
- data/lib/menu_builder/controller.rb +1 -1
- data/lib/menu_builder/version.rb +1 -1
- metadata +23 -19
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9892ebf03c1453e32f80de3f3bbbdd9da851a657
|
4
|
+
data.tar.gz: d0ffd34b7f563921e9af1e25605f0b5b93eb7a95
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 62dfbba5498cb7e7ae3c9013cb4f534d33615f85e0780cb9033bb57a4f8980d505d59dff52f8276c8c168c527351637bf9922655dfca7af10b43b8d54bfda9dd
|
7
|
+
data.tar.gz: 786bf942fe3ec80d7b64da0397594184d597d49671fc58c2bc3503fb9fe1e3e1955ad6b3925338bf3af9d4af4da5d5fcc20a6dc26e16714f58fa89d6e0655d43
|
data/README.rdoc
CHANGED
@@ -1,23 +1,16 @@
|
|
1
1
|
= menu_builder
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
A simple helper to make easier the process of highlighting menu items based on current
|
4
|
+
url. The goal here is to reduce the amount of if/elses you would typically need in your
|
5
|
+
views to achieve the same results.
|
5
6
|
|
6
7
|
== Instalation
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
gem.config "menu_builder", :version => '0.2.1'
|
11
|
-
|
12
|
-
Rails3
|
13
|
-
|
14
|
-
gem "menu_builder", '>=0.4.1'
|
9
|
+
gem "menu_builder"
|
15
10
|
|
16
11
|
== Usage
|
17
12
|
|
18
|
-
|
19
|
-
|
20
|
-
== Example
|
13
|
+
First flag at class level in your Controller which item should be highlighted
|
21
14
|
|
22
15
|
=== Controller
|
23
16
|
|
@@ -26,11 +19,13 @@ Just install the plugin and see the example below:
|
|
26
19
|
...
|
27
20
|
end
|
28
21
|
|
29
|
-
You can also change to menu item
|
22
|
+
You can also change to menu item at action level instead of class level. This
|
23
|
+
option is helpful when you have most of the actions pointing to one menu item
|
24
|
+
but a few actions pointing to another.
|
30
25
|
|
31
26
|
class DashboardController < ApplicationController
|
32
27
|
menu_item :mydashboard
|
33
|
-
|
28
|
+
|
34
29
|
def prices
|
35
30
|
menu_item :prices
|
36
31
|
...
|
@@ -59,8 +54,7 @@ You can also change to menu item in action level instead of class level:
|
|
59
54
|
|
60
55
|
==== Blocks for content
|
61
56
|
|
62
|
-
|
63
|
-
In this way you can create menu item with icons. Like below:
|
57
|
+
You can also pass blocks:
|
64
58
|
|
65
59
|
<%= menu do |m| %>
|
66
60
|
<% m.account account_path do %>
|
@@ -69,77 +63,3 @@ In this way you can create menu item with icons. Like below:
|
|
69
63
|
<%= m.users "Users", users_path %>
|
70
64
|
<%= m.posts "Posts", posts_path %>
|
71
65
|
<% end %>
|
72
|
-
|
73
|
-
== CSS and HTML
|
74
|
-
|
75
|
-
This plugin don't came with any kind of asset like image or css.
|
76
|
-
The layout of menu depends of your css. You can use any kind of CSS technique you want,
|
77
|
-
like below:
|
78
|
-
|
79
|
-
<html>
|
80
|
-
<head>
|
81
|
-
<style type="text/css" charset="utf-8">
|
82
|
-
#header ul { font-family:Tahoma; position: absolute; margin:0; list-style:none; }
|
83
|
-
#header li { display:inline; margin:0; padding:0; }
|
84
|
-
|
85
|
-
#header a {
|
86
|
-
float:left;
|
87
|
-
background: url(corner_left.jpg) no-repeat left top;
|
88
|
-
margin:0;
|
89
|
-
padding:0 0 0 4px;
|
90
|
-
text-decoration:none;
|
91
|
-
}
|
92
|
-
#header a span {
|
93
|
-
float:left;
|
94
|
-
display:block;
|
95
|
-
background: url(corner_right.jpg) no-repeat right top;
|
96
|
-
padding:4px 14px 4px 6px;
|
97
|
-
color:#FFF;
|
98
|
-
}
|
99
|
-
|
100
|
-
#header a:hover span { color:#FFF; }
|
101
|
-
#header a:hover { background-position:0% -43px; }
|
102
|
-
#header a:hover span { background-position:100% -43px; }
|
103
|
-
#header #current a { background-position:0% -43px; }
|
104
|
-
#header #current a span { background-position:100% -43px; }
|
105
|
-
</style>
|
106
|
-
</head>
|
107
|
-
|
108
|
-
<body>
|
109
|
-
<div id="header">
|
110
|
-
<ul>
|
111
|
-
<li><a href="#"><span>Home</span></a></li>
|
112
|
-
<li><a href="#"><span>Quem Somos</span></a></li>
|
113
|
-
<li><a href="#"><span>Portifólio</span></a></li>
|
114
|
-
<li><a href="#"><span>Contato</span></a></li>
|
115
|
-
</ul>
|
116
|
-
</div>
|
117
|
-
</body>
|
118
|
-
</html>
|
119
|
-
|
120
|
-
You can read a full tutorial and see a working demo of above in this
|
121
|
-
{link}[http://www.google.com/translate?langpair=pt|en&u=http://blog.areacriacoes.com.br//2009/1/23/bordas-arredondas-para-menus-em-abas]
|
122
|
-
|
123
|
-
== Author
|
124
|
-
|
125
|
-
Authors:: Daniel Lopes
|
126
|
-
Blog:: {http://blog.areacriacoes.com.br}[http://blog.areacriacoes.com.br]
|
127
|
-
Github:: {http://github.com/danielvlopes}[http://github.com/danielvlopes]
|
128
|
-
Twitter:: {danielvlopes}[http://blog.areacriacoes.com.br]
|
129
|
-
|
130
|
-
== Note on Patches/Pull Requests
|
131
|
-
|
132
|
-
* Fork the project.
|
133
|
-
* Make your feature addition or bug fix.
|
134
|
-
* Add tests for it. This is important so I don't break it in a
|
135
|
-
future version unintentionally.
|
136
|
-
* Commit, do not mess with rakefile, version, or history.
|
137
|
-
* Send me a pull request :)
|
138
|
-
|
139
|
-
== License
|
140
|
-
|
141
|
-
MenuBuilder is released under the MIT License.
|
142
|
-
|
143
|
-
== Copyright
|
144
|
-
|
145
|
-
Copyright (c) 2010 Daniel Lopes. See LICENSE for details.
|
data/lib/menu_builder/version.rb
CHANGED
metadata
CHANGED
@@ -1,38 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: menu_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Daniel Lopes
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: actionpack
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: activemodel
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- -
|
31
|
+
- - ">"
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '3.0'
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
36
41
|
description: helper and controller macros to define current menu item and also create
|
37
42
|
the menu in view.
|
38
43
|
email:
|
@@ -41,8 +46,8 @@ executables: []
|
|
41
46
|
extensions: []
|
42
47
|
extra_rdoc_files: []
|
43
48
|
files:
|
44
|
-
- .document
|
45
|
-
- .gitignore
|
49
|
+
- ".document"
|
50
|
+
- ".gitignore"
|
46
51
|
- Gemfile
|
47
52
|
- LICENSE
|
48
53
|
- README.rdoc
|
@@ -59,27 +64,26 @@ files:
|
|
59
64
|
- test/test_helper.rb
|
60
65
|
homepage: http://objetiva.co/
|
61
66
|
licenses: []
|
67
|
+
metadata: {}
|
62
68
|
post_install_message:
|
63
69
|
rdoc_options: []
|
64
70
|
require_paths:
|
65
71
|
- lib
|
66
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
73
|
requirements:
|
69
|
-
- -
|
74
|
+
- - ">="
|
70
75
|
- !ruby/object:Gem::Version
|
71
76
|
version: '0'
|
72
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
78
|
requirements:
|
75
|
-
- -
|
79
|
+
- - ">="
|
76
80
|
- !ruby/object:Gem::Version
|
77
81
|
version: '0'
|
78
82
|
requirements: []
|
79
83
|
rubyforge_project: menu_builder
|
80
|
-
rubygems_version:
|
84
|
+
rubygems_version: 2.6.12
|
81
85
|
signing_key:
|
82
|
-
specification_version:
|
86
|
+
specification_version: 4
|
83
87
|
summary: minimalist solution for menus and tabs in Rails
|
84
88
|
test_files:
|
85
89
|
- test/controller_test.rb
|