menu_builder 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +16 -14
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/menu_builder/helper.rb +7 -1
- data/menu_builder.gemspec +4 -4
- metadata +5 -5
data/README.rdoc
CHANGED
@@ -7,11 +7,11 @@ in controller. Easy like always should be!
|
|
7
7
|
|
8
8
|
As a Rail2.1+ gem
|
9
9
|
|
10
|
-
gem.config "
|
10
|
+
gem.config "menu_builder"
|
11
11
|
|
12
12
|
As Rails plugin
|
13
13
|
|
14
|
-
ruby script/plugin install git://github.com/danielvlopes/
|
14
|
+
ruby script/plugin install git://github.com/danielvlopes/menu_builder.git
|
15
15
|
|
16
16
|
== Usage
|
17
17
|
|
@@ -22,7 +22,7 @@ Just install the plugin and see the example below:
|
|
22
22
|
=== Controller
|
23
23
|
|
24
24
|
class DashboardController < ApplicationController
|
25
|
-
|
25
|
+
menu_item :mydashboard
|
26
26
|
...
|
27
27
|
end
|
28
28
|
|
@@ -30,7 +30,7 @@ Just install the plugin and see the example below:
|
|
30
30
|
|
31
31
|
==== ERB code
|
32
32
|
|
33
|
-
<% menu
|
33
|
+
<% menu(:id=>"mainMenu", :class=>"menu") do |m| %>
|
34
34
|
<%= m.account 'Account', account_path, :style => 'float: right' %>
|
35
35
|
<%= m.users 'Users', users_path, :style => 'float: right' %>
|
36
36
|
<%= m.mydashboard 'Dashboard', '/' %>
|
@@ -49,9 +49,9 @@ Just install the plugin and see the example below:
|
|
49
49
|
==== Blocks for content
|
50
50
|
|
51
51
|
Also is possible to pass blocks instead of simple strings for content.
|
52
|
-
In this way you can create
|
52
|
+
In this way you can create menu item with icons. Like below:
|
53
53
|
|
54
|
-
<% menu do |
|
54
|
+
<% menu do |m| %>
|
55
55
|
<% m.account account_path do %>
|
56
56
|
<%= image_tag "icon.jpg" /> Accounts
|
57
57
|
<% end %>
|
@@ -61,7 +61,9 @@ In this way you can create tabs with icons. Like below:
|
|
61
61
|
|
62
62
|
== CSS and HTML
|
63
63
|
|
64
|
-
This plugin don't came with any kind of asset like image or css.
|
64
|
+
This plugin don't came with any kind of asset like image or css.
|
65
|
+
The layout of menu depends of your css. You can use any kind of CSS technique you want,
|
66
|
+
like below:
|
65
67
|
|
66
68
|
<html>
|
67
69
|
<head>
|
@@ -104,11 +106,8 @@ This plugin don't came with any kind of asset like image or css. The layout of t
|
|
104
106
|
</body>
|
105
107
|
</html>
|
106
108
|
|
107
|
-
You can read a full tutorial and working demo of
|
108
|
-
|
109
|
-
== License
|
110
|
-
|
111
|
-
Tabs Helper is released under the MIT License.
|
109
|
+
You can read a full tutorial and see a working demo of above in this
|
110
|
+
{link}[http://www.google.com/translate?langpair=pt|en&u=http://blog.areacriacoes.com.br//2009/1/23/bordas-arredondas-para-menus-em-abas]
|
112
111
|
|
113
112
|
== Author
|
114
113
|
|
@@ -124,8 +123,11 @@ Twitter:: {danielvlopes}[http://blog.areacriacoes.com.br]
|
|
124
123
|
* Add tests for it. This is important so I don't break it in a
|
125
124
|
future version unintentionally.
|
126
125
|
* Commit, do not mess with rakefile, version, or history.
|
127
|
-
|
128
|
-
|
126
|
+
* Send me a pull request :)
|
127
|
+
|
128
|
+
== License
|
129
|
+
|
130
|
+
MenuBuilder is released under the MIT License.
|
129
131
|
|
130
132
|
== Copyright
|
131
133
|
|
data/Rakefile
CHANGED
@@ -5,8 +5,8 @@ begin
|
|
5
5
|
require 'jeweler'
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "menu_builder"
|
8
|
-
gem.summary = %Q{ Killer
|
9
|
-
gem.description = %Q{
|
8
|
+
gem.summary = %Q{ Killer solution for menus and tabs in Rails }
|
9
|
+
gem.description = %Q{ helper and controller macros to define current menu item and also create the menu in view. }
|
10
10
|
gem.email = "danielvlopes@gmail.com"
|
11
11
|
gem.homepage = "http://github.com/danielvlopes/menu_builder"
|
12
12
|
gem.authors = ["Daniel Lopes"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/menu_builder/helper.rb
CHANGED
@@ -21,7 +21,13 @@ module MenuBuilder
|
|
21
21
|
def menu(options={})
|
22
22
|
concat tag(:ul, options, true)
|
23
23
|
yield Menu.new(self)
|
24
|
-
concat "</ul>"
|
24
|
+
concat safe_html("</ul>")
|
25
25
|
end
|
26
|
+
|
27
|
+
private
|
28
|
+
def safe_html(html)
|
29
|
+
html.respond_to?(:html_safe) ? html.html_safe : html
|
30
|
+
end
|
31
|
+
|
26
32
|
end
|
27
33
|
end
|
data/menu_builder.gemspec
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{menu_builder}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Daniel Lopes"]
|
12
|
-
s.date = %q{2010-03-
|
13
|
-
s.description = %q{
|
12
|
+
s.date = %q{2010-03-20}
|
13
|
+
s.description = %q{ helper and controller macros to define current menu item and also create the menu in view. }
|
14
14
|
s.email = %q{danielvlopes@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.rdoc_options = ["--charset=UTF-8"]
|
38
38
|
s.require_paths = ["lib"]
|
39
39
|
s.rubygems_version = %q{1.3.6}
|
40
|
-
s.summary = %q{Killer
|
40
|
+
s.summary = %q{Killer solution for menus and tabs in Rails}
|
41
41
|
s.test_files = [
|
42
42
|
"test/controller_test.rb",
|
43
43
|
"test/helper_test.rb",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Daniel Lopes
|
@@ -14,11 +14,11 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-20 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
21
|
-
description: "
|
21
|
+
description: " helper and controller macros to define current menu item and also create the menu in view. "
|
22
22
|
email: danielvlopes@gmail.com
|
23
23
|
executables: []
|
24
24
|
|
@@ -72,7 +72,7 @@ rubyforge_project:
|
|
72
72
|
rubygems_version: 1.3.6
|
73
73
|
signing_key:
|
74
74
|
specification_version: 3
|
75
|
-
summary: Killer
|
75
|
+
summary: Killer solution for menus and tabs in Rails
|
76
76
|
test_files:
|
77
77
|
- test/controller_test.rb
|
78
78
|
- test/helper_test.rb
|