<commit_before>= menu_builder

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
  
  gem.config "tabs_helper"

As Rails plugin

  ruby script/plugin install git://github.com/danielvlopes/tabs_helper.git

== Usage

Just install the plugin and see the example below:

== Example

=== Controller

  class DashboardController < ApplicationController
    current_tab :mydashboard
    ...
  end

=== View

==== ERB code

  <% 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 %>

==== HTML Result

   <ul id="mainMenu" class="menu">
     <li><a href="/accounts">Account</a></li>
     <li><a href="/users">Users</a></li>
     <li><a href="/" class="current">Dashboard</a></li>
     <li><a href="/projects">Projects</a></li>
   </ul>

==== Blocks for content

Also is possible to pass blocks instead of simple strings for content.
In this way you can create tabs with icons. Like below:

  <% menu do |tab| %>
    <% m.account account_path do %>
      <%= image_tag "icon.jpg" /> Accounts
    <% end %>
    <%= m.users "Users", users_path %>
    <%= m.posts "Posts", posts_path %>
  <% end %>

== CSS and HTML

This plugin don't came with any kind of asset like image or css. The layout of tabs and the way of show it depends of you css architecture. You can use any kind of technique with html UL and LI, like below:

  <html>
  <head>
    <style type="text/css" charset="utf-8">
      #header ul { font-family:Tahoma; position: absolute; margin:0; list-style:none; }
      #header li { display:inline; margin:0; padding:0; }

      #header a {
         float:left;
         background: url(corner_left.jpg) no-repeat left top;
         margin:0;
         padding:0 0 0 4px;
         text-decoration:none;
      }
      #header a span {
         float:left;
         display:block;
         background: url(corner_right.jpg) no-repeat right top;
         padding:4px 14px 4px 6px;
         color:#FFF;
      }

      #header a:hover span { color:#FFF; }
      #header a:hover { background-position:0% -43px; }
      #header a:hover span { background-position:100% -43px; }
      #header #current a { background-position:0% -43px; }
      #header #current a span { background-position:100% -43px; }
    </style>
  </head>

  <body>
    <div id="header">
      <ul>
        <li><a href="#"><span>Home</span></a></li>
        <li><a href="#"><span>Quem Somos</span></a></li>
        <li><a href="#"><span>Portif&oacute;lio</span></a></li>
        <li><a href="#"><span>Contato</span></a></li>
      </ul>
    </div>
  </body>
  </html>

You can read a full tutorial and working demo of the technique above in this "link":http://www.google.com/translate?langpair=pt|en&u=http://blog.areacriacoes.com.br//2009/1/23/bordas-arredondas-para-menus-em-abas

== License

Tabs Helper is released under the MIT License.

== Author

Authors::   <NAME>
Blog::      {http://blog.areacriacoes.com.br}[http://blog.areacriacoes.com.br]
Github::    {http://github.com/danielvlopes}[http://github.com/danielvlopes]
Twitter::   {danielvlopes}[http://blog.areacriacoes.com.br]

== Note on Patches/Pull Requests
 
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 <NAME>. See LICENSE for details.<commit_msg>fix readme<commit_after>= menu_builder

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
  
  gem.config "menu_builder"

As Rails plugin

  ruby script/plugin install git://github.com/danielvlopes/menu_builder.git

== Usage

Just install the plugin and see the example below:

== Example

=== Controller

  class DashboardController < ApplicationController
    menu_item :mydashboard
    ...
  end

=== View

==== ERB code

  <% 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 %>

==== HTML Result

   <ul id="mainMenu" class="menu">
     <li><a href="/accounts">Account</a></li>
     <li><a href="/users">Users</a></li>
     <li><a href="/" class="current">Dashboard</a></li>
     <li><a href="/projects">Projects</a></li>
   </ul>

==== 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| %>
    <% m.account account_path do %>
      <%= image_tag "icon.jpg" /> Accounts
    <% end %>
    <%= m.users "Users", users_path %>
    <%= m.posts "Posts", posts_path %>
  <% end %>

== CSS and HTML

This plugin don't came with any kind of asset like image or css. 
The layout of menu depends of your css. You can use any kind of CSS technique  you want, 
like below:

  <html>
  <head>
    <style type="text/css" charset="utf-8">
      #header ul { font-family:Tahoma; position: absolute; margin:0; list-style:none; }
      #header li { display:inline; margin:0; padding:0; }

      #header a {
         float:left;
         background: url(corner_left.jpg) no-repeat left top;
         margin:0;
         padding:0 0 0 4px;
         text-decoration:none;
      }
      #header a span {
         float:left;
         display:block;
         background: url(corner_right.jpg) no-repeat right top;
         padding:4px 14px 4px 6px;
         color:#FFF;
      }

      #header a:hover span { color:#FFF; }
      #header a:hover { background-position:0% -43px; }
      #header a:hover span { background-position:100% -43px; }
      #header #current a { background-position:0% -43px; }
      #header #current a span { background-position:100% -43px; }
    </style>
  </head>

  <body>
    <div id="header">
      <ul>
        <li><a href="#"><span>Home</span></a></li>
        <li><a href="#"><span>Quem Somos</span></a></li>
        <li><a href="#"><span>Portif&oacute;lio</span></a></li>
        <li><a href="#"><span>Contato</span></a></li>
      </ul>
    </div>
  </body>
  </html>

You can read a full tutorial and see a working demo of above in this 
{link}[http://www.google.com/translate?langpair=pt|en&u=http://blog.areacriacoes.com.br//2009/1/23/bordas-arredondas-para-menus-em-abas]

== Author

Authors::   <NAME>
Blog::      {http://blog.areacriacoes.com.br}[http://blog.areacriacoes.com.br]
Github::    {http://github.com/danielvlopes}[http://github.com/danielvlopes]
Twitter::   {danielvlopes}[http://blog.areacriacoes.com.br]

== Note on Patches/Pull Requests
 
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
* Send me a pull request :)

== License

MenuBuilder is released under the MIT License.

== Copyright

Copyright (c) 2010 <NAME>. See LICENSE for details.
{'fraction_non_alphanumeric': 0.15267775304438916, 'fraction_numerical': 0.011260966348042425, 'mean_word_length': 3.0498409331919407, 'pattern_counts': {'":': 1, '<': 143, '<?xml version=': 0, '>': 149, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5657453', 'n_tokens_mistral': 2646, 'n_tokens_neox': 2488, 'n_words': 753}