README.rdoc in menu_builder-0.2.1 vs README.rdoc in menu_builder-0.3.0
- old
+ new
@@ -3,18 +3,18 @@
With this gem/plugin you get a helper to define menus and also can control the current item of menu
in controller. Easy like always should be!
== Instalation
-As a Rail2.1+ gem
+Rail2
- gem.config "menu_builder"
+ gem.config "menu_builder", :version => '0.2.1'
+
+Rails3
-As Rails plugin
+ gem "menu_builder", '>=0.2.2'
- ruby script/plugin install git://github.com/danielvlopes/menu_builder.git
-
== Usage
Just install the plugin and see the example below:
== Example
@@ -28,11 +28,11 @@
=== View
==== ERB code
- <% menu(:id=>"mainMenu", :class=>"menu") do |m| %>
+ <%= menu(:id=>"mainMenu", :class=>"menu") do |m| %>
<%= m.account 'Account', account_path, :style => 'float: right' %>
<%= m.users 'Users', users_path, :style => 'float: right' %>
<%= m.mydashboard 'Dashboard', '/' %>
<%= m.projects 'Projects', projects_path %>
<% end %>
@@ -49,10 +49,10 @@
==== Blocks for content
Also is possible to pass blocks instead of simple strings for content.
In this way you can create menu item with icons. Like below:
- <% menu do |m| %>
+ <%= menu do |m| %>
<% m.account account_path do %>
<%= image_tag "icon.jpg" /> Accounts
<% end %>
<%= m.users "Users", users_path %>
<%= m.posts "Posts", posts_path %>
\ No newline at end of file