diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index c4f5fbc..1dcfc32 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -1,5 +1,5 @@
class HomeController < ApplicationController
- current_tab :home
+ menu_item :home
def index
@next_meeting = Meeting.next(Date.today).first
diff --git a/app/controllers/meetings_controller.rb b/app/controllers/meetings_controller.rb
index a449d67..8891ca2 100644
--- a/app/controllers/meetings_controller.rb
+++ b/app/controllers/meetings_controller.rb
@@ -1,7 +1,7 @@
class MeetingsController < ApplicationController
load_and_authorize_resource
inherit_resources
- current_tab :meetings
+ menu_item :meetings
def index
@next_meeting = Meeting.next(Date.today).first
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 00ba613..40bf7b9 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -1,5 +1,5 @@
class ProjectsController < ApplicationController
- current_tab :projects
+ menu_item :projects
def index
@users = User.active.with_projects
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index e084626..be90b5f 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,7 +1,7 @@
class UsersController < ApplicationController
load_and_authorize_resource
inherit_resources
- current_tab :users
+ menu_item :users
respond_to :html, :xml, :json
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index d4d2533..50feb32 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -24,11 +24,11 @@
= link_to 'railsmg', root_path
%nav#nav
- - tabs :class=>"menu" do |tab|
- = tab.home 'Home', root_path
- = tab.users 'Membros', users_path
- = tab.projects 'Projetos', projects_path
- = tab.meetings 'Encontros', meetings_path
+ - menu :class=>"menu" do |m|
+ = m.home 'Home', root_path
+ = m.users 'Membros', users_path
+ = m.projects 'Projetos', projects_path
+ = m.meetings 'Encontros', meetings_path
#content{ :class => "#{controller.controller_name} #{controller.action_name}" }
= yield
diff --git a/config/environment.rb b/config/environment.rb
index dad12c4..3f861c0 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -21,6 +21,7 @@
config.gem 'cancan', :version => '1.0.2'
config.gem 'haml', :version => '2.2.15'
config.gem 'formtastic', :version => '0.9.7'
+ config.gem 'menu_builder', :version => '0.2.0'
config.gem 'paperclip', :version => '2.3.1.1'
config.gem 'inherited_resources', :version => '0.9.4'
diff --git a/vendor/gems/menu_builder-0.0.2/.document b/vendor/gems/menu_builder-0.0.2/.document
new file mode 100644
index 0000000..ecf3673
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/.document
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
diff --git a/vendor/gems/menu_builder-0.0.2/.gitignore b/vendor/gems/menu_builder-0.0.2/.gitignore
new file mode 100644
index 0000000..c1e0daf
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/.gitignore
@@ -0,0 +1,21 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
diff --git a/vendor/gems/menu_builder-0.0.2/.specification b/vendor/gems/menu_builder-0.0.2/.specification
new file mode 100644
index 0000000..abfacc5
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/.specification
@@ -0,0 +1,76 @@
+--- !ruby/object:Gem::Specification
+name: menu_builder
+version: !ruby/object:Gem::Version
+ prerelease: false
+ segments:
+ - 0
+ - 0
+ - 2
+ version: 0.0.2
+platform: ruby
+authors:
+- Daniel Lopes
+autorequire:
+bindir: bin
+cert_chain: []
+
+date: 2010-03-06 00:00:00 -03:00
+default_executable:
+dependencies: []
+
+description: " Some helpers for define current tab (or item) of menu in controller and also create the menu in view. "
+email: danielvlopes@gmail.com
+executables: []
+
+extensions: []
+
+extra_rdoc_files:
+- LICENSE
+- README.rdoc
+files:
+- .document
+- .gitignore
+- LICENSE
+- README.rdoc
+- Rakefile
+- VERSION
+- init.rb
+- lib/menu_builder.rb
+- lib/menu_builder/controller.rb
+- lib/menu_builder/view.rb
+- menu_builder.gemspec
+- test/helper.rb
+- test/test_menu_builder.rb
+has_rdoc: true
+homepage: http://github.com/danielvlopes/menu_builder
+licenses: []
+
+post_install_message:
+rdoc_options:
+- --charset=UTF-8
+require_paths:
+- lib
+required_ruby_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ segments:
+ - 0
+ version: "0"
+required_rubygems_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ segments:
+ - 0
+ version: "0"
+requirements: []
+
+rubyforge_project:
+rubygems_version: 1.3.6
+signing_key:
+specification_version: 3
+summary: Killer solutions for menus and tabs for Rails
+test_files:
+- test/helper.rb
+- test/test_menu_builder.rb
diff --git a/vendor/plugins/tabs_helper/MIT-LICENSE b/vendor/gems/menu_builder-0.0.2/LICENSE
old mode 100755
new mode 100644
similarity index 95%
rename from vendor/plugins/tabs_helper/MIT-LICENSE
rename to vendor/gems/menu_builder-0.0.2/LICENSE
index 8eaf6db..17ad811
--- a/vendor/plugins/tabs_helper/MIT-LICENSE
+++ b/vendor/gems/menu_builder-0.0.2/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2008 [name of plugin creator]
+Copyright (c) 2009 Daniel Lopes
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/vendor/gems/menu_builder-0.0.2/README.rdoc b/vendor/gems/menu_builder-0.0.2/README.rdoc
new file mode 100644
index 0000000..d9d9343
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/README.rdoc
@@ -0,0 +1,136 @@
+= 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
+
+ <% tabs :id=>"mainMenu", :class=>"menu" do |tab| %>
+ <%= tab.account 'Account', account_path, :style => 'float: right' %>
+ <%= tab.users 'Users', users_path, :style => 'float: right' %>
+ <%= tab.mydashboard 'Dashboard', '/' %>
+ <%= tab.projects 'Projects', projects_path %>
+ <% end %>
+
+==== HTML Result
+
+
+
+==== 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:
+
+ <% tabs do |tab| %>
+ <% tab.account account_path do %>
+ <%= image_tag "account.jpg" /> Accounts
+ <% end %>
+ <% tab.users users_path do %>
+ <%= image_tag "user.jpg" /> Users
+ <% end %>
+ <% tab.posts posts_path do %>
+ <%= image_tag "posts.jpg" /> Posts
+ <% end %>
+ <% 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:
+
+
+
+
+
+
+
+
+
+
+
+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:: Daniel Lopes
+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 Daniel Lopes. See LICENSE for details.
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.0.2/Rakefile b/vendor/gems/menu_builder-0.0.2/Rakefile
new file mode 100644
index 0000000..0cbd88a
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/Rakefile
@@ -0,0 +1,51 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "menu_builder"
+ gem.summary = %Q{ Killer solutions for menus and tabs for Rails }
+ gem.description = %Q{ Some helpers for define current tab (or item) of menu in controller and also create the menu in view. }
+ gem.email = "danielvlopes@gmail.com"
+ gem.homepage = "http://github.com/danielvlopes/menu_builder"
+ gem.authors = ["Daniel Lopes"]
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+end
+
+begin
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+ end
+rescue LoadError
+ task :rcov do
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
+ end
+end
+
+task :test => :check_dependencies
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "menu_builder #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
diff --git a/vendor/gems/menu_builder-0.0.2/VERSION b/vendor/gems/menu_builder-0.0.2/VERSION
new file mode 100644
index 0000000..4e379d2
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/VERSION
@@ -0,0 +1 @@
+0.0.2
diff --git a/vendor/gems/menu_builder-0.0.2/init.rb b/vendor/gems/menu_builder-0.0.2/init.rb
new file mode 100755
index 0000000..84a1e88
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/init.rb
@@ -0,0 +1 @@
+require "menu_builder"
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.0.2/lib/menu_builder.rb b/vendor/gems/menu_builder-0.0.2/lib/menu_builder.rb
new file mode 100644
index 0000000..0eb182f
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/lib/menu_builder.rb
@@ -0,0 +1,5 @@
+require 'menu_builder/controller'
+require 'menu_builder/view'
+
+ActionController::Base.extend(MenuBuilder::Controller)
+ActionView::Base.send(:include, MenuBuilder::ViewHelpers)
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.0.2/lib/menu_builder/controller.rb b/vendor/gems/menu_builder-0.0.2/lib/menu_builder/controller.rb
new file mode 100644
index 0000000..05d8964
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/lib/menu_builder/controller.rb
@@ -0,0 +1,11 @@
+module MenuBuilder
+ module Controller
+
+ def current_tab(name, options = {})
+ before_filter(options) do |controller|
+ controller.instance_variable_set('@current_tab', name)
+ end
+ end
+
+ end
+end
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.0.2/lib/menu_builder/view.rb b/vendor/gems/menu_builder-0.0.2/lib/menu_builder/view.rb
new file mode 100644
index 0000000..8b9984f
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/lib/menu_builder/view.rb
@@ -0,0 +1,28 @@
+module MenuBuilder
+ module ViewHelpers
+ class Tab
+
+ def initialize(context)
+ @context = context
+ @current_tab = @context.instance_variable_get('@current_tab')
+ end
+
+ def current_tab?(tab)
+ @current_tab.to_s == tab.to_s
+ end
+
+ def method_missing(tab, *args, &block)
+ css_class = "current" if current_tab?(tab)
+ @context.content_tag :li, @context.link_to(*args, &block), :class=>css_class
+ end
+
+ end
+
+ def tabs(options={})
+ concat tag(:ul, options, true)
+ yield Tab.new(self)
+ concat ""
+ end
+
+ end
+end
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.0.2/menu_builder.gemspec b/vendor/gems/menu_builder-0.0.2/menu_builder.gemspec
new file mode 100644
index 0000000..ef69c21
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/menu_builder.gemspec
@@ -0,0 +1,54 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{menu_builder}
+ s.version = "0.0.2"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Daniel Lopes"]
+ s.date = %q{2010-03-06}
+ s.description = %q{ Some helpers for define current tab (or item) of menu in controller and also create the menu in view. }
+ s.email = %q{danielvlopes@gmail.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ ".document",
+ ".gitignore",
+ "LICENSE",
+ "README.rdoc",
+ "Rakefile",
+ "VERSION",
+ "init.rb",
+ "lib/menu_builder.rb",
+ "lib/menu_builder/controller.rb",
+ "lib/menu_builder/view.rb",
+ "menu_builder.gemspec",
+ "test/helper.rb",
+ "test/test_menu_builder.rb"
+ ]
+ s.homepage = %q{http://github.com/danielvlopes/menu_builder}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.6}
+ s.summary = %q{Killer solutions for menus and tabs for Rails}
+ s.test_files = [
+ "test/helper.rb",
+ "test/test_menu_builder.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
+
diff --git a/vendor/gems/menu_builder-0.0.2/test/helper.rb b/vendor/gems/menu_builder-0.0.2/test/helper.rb
new file mode 100644
index 0000000..7d9361c
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/test/helper.rb
@@ -0,0 +1,10 @@
+require 'rubygems'
+require 'test/unit'
+
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+
+require 'menu_builder'
+
+class Test::Unit::TestCase
+end
diff --git a/vendor/gems/menu_builder-0.0.2/test/test_menu_builder.rb b/vendor/gems/menu_builder-0.0.2/test/test_menu_builder.rb
new file mode 100644
index 0000000..6ec883a
--- /dev/null
+++ b/vendor/gems/menu_builder-0.0.2/test/test_menu_builder.rb
@@ -0,0 +1,5 @@
+require 'helper'
+
+class TestMenuBuilder < Test::Unit::TestCase
+ # TODO WRITE TESTS
+end
diff --git a/vendor/gems/menu_builder-0.2.0/.document b/vendor/gems/menu_builder-0.2.0/.document
new file mode 100644
index 0000000..ecf3673
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/.document
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
diff --git a/vendor/gems/menu_builder-0.2.0/.gitignore b/vendor/gems/menu_builder-0.2.0/.gitignore
new file mode 100644
index 0000000..c1e0daf
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/.gitignore
@@ -0,0 +1,21 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
diff --git a/vendor/gems/menu_builder-0.2.0/.specification b/vendor/gems/menu_builder-0.2.0/.specification
new file mode 100644
index 0000000..5251ab5
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/.specification
@@ -0,0 +1,80 @@
+--- !ruby/object:Gem::Specification
+name: menu_builder
+version: !ruby/object:Gem::Version
+ prerelease: false
+ segments:
+ - 0
+ - 2
+ - 0
+ version: 0.2.0
+platform: ruby
+authors:
+- Daniel Lopes
+autorequire:
+bindir: bin
+cert_chain: []
+
+date: 2010-03-06 00:00:00 -03:00
+default_executable:
+dependencies: []
+
+description: " Some helpers for define current tab (or item) of menu in controller and also create the menu in view. "
+email: danielvlopes@gmail.com
+executables: []
+
+extensions: []
+
+extra_rdoc_files:
+- LICENSE
+- README.rdoc
+files:
+- .document
+- .gitignore
+- LICENSE
+- README.rdoc
+- Rakefile
+- VERSION
+- init.rb
+- lib/menu_builder.rb
+- lib/menu_builder/controller.rb
+- lib/menu_builder/helper.rb
+- menu_builder.gemspec
+- test/controller_test.rb
+- test/helper_test.rb
+- test/support/controllers.rb
+- test/test_helper.rb
+has_rdoc: true
+homepage: http://github.com/danielvlopes/menu_builder
+licenses: []
+
+post_install_message:
+rdoc_options:
+- --charset=UTF-8
+require_paths:
+- lib
+required_ruby_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ segments:
+ - 0
+ version: "0"
+required_rubygems_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ segments:
+ - 0
+ version: "0"
+requirements: []
+
+rubyforge_project:
+rubygems_version: 1.3.6
+signing_key:
+specification_version: 3
+summary: Killer solutions for menus and tabs for Rails
+test_files:
+- test/controller_test.rb
+- test/helper_test.rb
+- test/support/controllers.rb
+- test/test_helper.rb
diff --git a/vendor/gems/menu_builder-0.2.0/LICENSE b/vendor/gems/menu_builder-0.2.0/LICENSE
new file mode 100644
index 0000000..17ad811
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Daniel Lopes
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/gems/menu_builder-0.2.0/README.rdoc b/vendor/gems/menu_builder-0.2.0/README.rdoc
new file mode 100644
index 0000000..41d1a1f
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/README.rdoc
@@ -0,0 +1,132 @@
+= 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
+
+
+
+==== 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:
+
+
+
+
+
+
+
+
+
+
+
+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:: Daniel Lopes
+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 Daniel Lopes. See LICENSE for details.
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.2.0/Rakefile b/vendor/gems/menu_builder-0.2.0/Rakefile
new file mode 100644
index 0000000..0cbd88a
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/Rakefile
@@ -0,0 +1,51 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "menu_builder"
+ gem.summary = %Q{ Killer solutions for menus and tabs for Rails }
+ gem.description = %Q{ Some helpers for define current tab (or item) of menu in controller and also create the menu in view. }
+ gem.email = "danielvlopes@gmail.com"
+ gem.homepage = "http://github.com/danielvlopes/menu_builder"
+ gem.authors = ["Daniel Lopes"]
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+end
+
+begin
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+ end
+rescue LoadError
+ task :rcov do
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
+ end
+end
+
+task :test => :check_dependencies
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "menu_builder #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
diff --git a/vendor/gems/menu_builder-0.2.0/VERSION b/vendor/gems/menu_builder-0.2.0/VERSION
new file mode 100644
index 0000000..0ea3a94
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/VERSION
@@ -0,0 +1 @@
+0.2.0
diff --git a/vendor/gems/menu_builder-0.2.0/init.rb b/vendor/gems/menu_builder-0.2.0/init.rb
new file mode 100755
index 0000000..84a1e88
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/init.rb
@@ -0,0 +1 @@
+require "menu_builder"
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.2.0/lib/menu_builder.rb b/vendor/gems/menu_builder-0.2.0/lib/menu_builder.rb
new file mode 100644
index 0000000..1a08885
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/lib/menu_builder.rb
@@ -0,0 +1,5 @@
+require 'menu_builder/controller'
+require 'menu_builder/helper'
+
+ActionController::Base.extend(MenuBuilder::Controller)
+ActionView::Base.send(:include, MenuBuilder::ViewHelpers)
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.2.0/lib/menu_builder/controller.rb b/vendor/gems/menu_builder-0.2.0/lib/menu_builder/controller.rb
new file mode 100644
index 0000000..b1ef8c0
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/lib/menu_builder/controller.rb
@@ -0,0 +1,11 @@
+module MenuBuilder
+ module Controller
+
+ def menu_item(name, options = {})
+ before_filter(options) do |controller|
+ controller.instance_variable_set('@menu_item', name)
+ end
+ end
+
+ end
+end
diff --git a/vendor/gems/menu_builder-0.2.0/lib/menu_builder/helper.rb b/vendor/gems/menu_builder-0.2.0/lib/menu_builder/helper.rb
new file mode 100644
index 0000000..a7a5f3d
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/lib/menu_builder/helper.rb
@@ -0,0 +1,27 @@
+module MenuBuilder
+ module ViewHelpers
+ class Menu
+
+ def initialize(context)
+ @context = context
+ @menu_item = @context.instance_variable_get('@menu_item')
+ end
+
+ def current_item?(item)
+ @menu_item.to_s == item.to_s
+ end
+
+ def method_missing(item, *args, &block)
+ css_class = "current" if current_item?(item)
+ @context.content_tag :li, @context.link_to(*args, &block), :class=>css_class
+ end
+
+ end
+
+ def menu(options={})
+ concat tag(:ul, options, true)
+ yield Menu.new(self)
+ concat ""
+ end
+ end
+end
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.2.0/menu_builder.gemspec b/vendor/gems/menu_builder-0.2.0/menu_builder.gemspec
new file mode 100644
index 0000000..64d1b9a
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/menu_builder.gemspec
@@ -0,0 +1,58 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{menu_builder}
+ s.version = "0.2.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Daniel Lopes"]
+ s.date = %q{2010-03-06}
+ s.description = %q{ Some helpers for define current tab (or item) of menu in controller and also create the menu in view. }
+ s.email = %q{danielvlopes@gmail.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ ".document",
+ ".gitignore",
+ "LICENSE",
+ "README.rdoc",
+ "Rakefile",
+ "VERSION",
+ "init.rb",
+ "lib/menu_builder.rb",
+ "lib/menu_builder/controller.rb",
+ "lib/menu_builder/helper.rb",
+ "menu_builder.gemspec",
+ "test/controller_test.rb",
+ "test/helper_test.rb",
+ "test/support/controllers.rb",
+ "test/test_helper.rb"
+ ]
+ s.homepage = %q{http://github.com/danielvlopes/menu_builder}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.6}
+ s.summary = %q{Killer solutions for menus and tabs for Rails}
+ s.test_files = [
+ "test/controller_test.rb",
+ "test/helper_test.rb",
+ "test/support/controllers.rb",
+ "test/test_helper.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
+
diff --git a/vendor/gems/menu_builder-0.2.0/test/controller_test.rb b/vendor/gems/menu_builder-0.2.0/test/controller_test.rb
new file mode 100644
index 0000000..a33867e
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/test/controller_test.rb
@@ -0,0 +1,18 @@
+require "test_helper"
+
+class BooksController < ApplicationController
+ menu_item :home
+
+ def index
+ end
+end
+
+class MenuBuilderTest < ActionController::TestCase
+ tests BooksController
+
+ test "should assigns the current tab" do
+ get :index
+ assert_equal(:home, assigns(:menu_item))
+ end
+
+end
diff --git a/vendor/gems/menu_builder-0.2.0/test/helper_test.rb b/vendor/gems/menu_builder-0.2.0/test/helper_test.rb
new file mode 100644
index 0000000..ed9da35
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/test/helper_test.rb
@@ -0,0 +1,43 @@
+require "test_helper"
+
+class HelperTest < ActionView::TestCase
+ tests MenuBuilder::ViewHelpers
+
+ test "menu yields an instance of Menu" do
+ menu do |m|
+ assert m.instance_of?(MenuBuilder::ViewHelpers::Menu)
+ end
+ end
+
+ test "menu create an unordered list" do
+ menu :id=>"menu" do |m| end
+ assert_select "ul#menu"
+ end
+
+ test "menu should accept html options like classes and id" do
+ menu :id=>"menu", :class=>"tabs" do |m| end
+ assert_select "ul#menu.tabs"
+ end
+
+ test "menu should create a line item" do
+ menu { |m| concat m.home "Home", "#" }
+ assert_select "li", 1
+ end
+
+ test "should create a link inside line item" do
+ menu { |m| concat m.home "Home", "/" }
+ expected = %()
+ assert_dom_equal expected, output_buffer
+ end
+
+ test "should set the class to the current item li" do
+ @menu_item = :home
+ menu do |m|
+ concat m.home "Home", "/"
+ concat m.contact "Store", "/store"
+ end
+
+ assert_select "li.current", 1
+ end
+
+end
\ No newline at end of file
diff --git a/vendor/gems/menu_builder-0.2.0/test/support/controllers.rb b/vendor/gems/menu_builder-0.2.0/test/support/controllers.rb
new file mode 100644
index 0000000..b2a8f6f
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/test/support/controllers.rb
@@ -0,0 +1,13 @@
+require 'active_support'
+require 'action_controller'
+
+ActionController::Routing::Routes.draw do |map|
+ map.connect ':controller/:action/:id'
+end
+
+class ApplicationController < ActionController::Base
+ protected
+ def default_render
+ render :text => action_name
+ end
+end
diff --git a/vendor/gems/menu_builder-0.2.0/test/test_helper.rb b/vendor/gems/menu_builder-0.2.0/test/test_helper.rb
new file mode 100644
index 0000000..9bcc40f
--- /dev/null
+++ b/vendor/gems/menu_builder-0.2.0/test/test_helper.rb
@@ -0,0 +1,11 @@
+require 'rubygems'
+require 'test/unit'
+require 'action_controller'
+require 'action_view/test_case'
+
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+
+Dir["#{File.dirname(__FILE__)}/support/*.rb"].each { |f| require f }
+
+require 'menu_builder'
\ No newline at end of file
diff --git a/vendor/plugins/tabs_helper/README.textile b/vendor/plugins/tabs_helper/README.textile
deleted file mode 100755
index 7c1df2f..0000000
--- a/vendor/plugins/tabs_helper/README.textile
+++ /dev/null
@@ -1,136 +0,0 @@
-h1. Tabs Helper
-
-This plugin is a Ruby on Rails helper for tabbed interface with control of current tab and different styled tabs.
-Very useful for web appications.
-
-h2. INSTALATION
-
-
- ruby script/plugin install git://github.com/danielvlopes/tabs_helper.git
-
-
-h2. USAGE
-
-Just install the plugin and see the example below:
-
-h2. EXAMPLE
-
-h3. Controller
-
-
-class DashboardController < ApplicationController
- current_tab :mydashboard
- ...
-end
-
-
-h3. View
-
-*ERB code*
-
-
-<% tabs :id=>"mainMenu", :class=>"menu" do |tab| %>
- <%= tab.account 'Account', account_path, :style => 'float: right' %>
- <%= tab.users 'Users', users_path, :style => 'float: right' %>
- <%= tab.mydashboard 'Dashboard', '/' %>
- <%= tab.projects 'Projects', projects_path %>
-<% end %>
-
-
-*HTML Result*
-
-
-
-
-
-*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:
-
-
-<% tabs do |tab| %>
- <% tab.account account_path do %>
- <%= image_tag "account.jpg" /> Accounts
- <% end %>
- <% tab.users users_path do %>
- <%= image_tag "user.jpg" /> Users
- <% end %>
- <% tab.posts posts_path do %>
- <%= image_tag "posts.jpg" /> Posts
- <% end %>
-<% end %>
-
-
-h2. 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:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
-
-h2. LICENSE
-
-Tabs Helper is released under the MIT License.
-
-h2. AUTHOR
-
-*Daniel Lopes*
-
-Blog: "http://blog.areacriacoes.com.br":http://blog.areacriacoes.com.br
-Github: "http://github.com/danielvlopes":http://github.com/danielvlopes
-
-This plugin is based on *Rafael Lima* works in http://github.com/rafaelp/tabs_helper/tree/master
-
-Blog: "http://rafael.adm.br":http://rafael.adm.br
-Github: "http://github.com/rafaelp":http://github.com/rafaelp
\ No newline at end of file
diff --git a/vendor/plugins/tabs_helper/Rakefile b/vendor/plugins/tabs_helper/Rakefile
deleted file mode 100755
index a4e0c52..0000000
--- a/vendor/plugins/tabs_helper/Rakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-desc 'Default: run unit tests.'
-task :default => :test
-
-desc 'Test the tabs_for_rails plugin.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-desc 'Generate documentation for the tabs_for_rails plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'TabsForRails'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
diff --git a/vendor/plugins/tabs_helper/init.rb b/vendor/plugins/tabs_helper/init.rb
deleted file mode 100755
index c1cd773..0000000
--- a/vendor/plugins/tabs_helper/init.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-# Include hook code here
-
-ActionController::Base.send :include, TabsHelper
-ActionView::Base.send :include, TabsHelper::Helpers::ViewHelpers
diff --git a/vendor/plugins/tabs_helper/install.rb b/vendor/plugins/tabs_helper/install.rb
deleted file mode 100755
index f7732d3..0000000
--- a/vendor/plugins/tabs_helper/install.rb
+++ /dev/null
@@ -1 +0,0 @@
-# Install hook code here
diff --git a/vendor/plugins/tabs_helper/lib/tabs_helper.rb b/vendor/plugins/tabs_helper/lib/tabs_helper.rb
deleted file mode 100755
index 199a14c..0000000
--- a/vendor/plugins/tabs_helper/lib/tabs_helper.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-# TabsForRails
-module TabsHelper
-
- def self.included(base) # base is the class that included the module
- base.extend(ClassMethods)
- end
-
- #
- # Example:
- #
- # # Controller
- # class DashboardController < ApplicationController
- # current_tab :mydashboard
- # end
- #
- # # View
- # <% tabs do |tab| %>
- # <%= tab.account 'Account', account_path, :style => 'float: right' %>
- # <%= tab.users 'Users', users_path, :style => 'float: right' %>
- # <%= tab.mydashboard 'Dashboard', '/' %>
- # <%= tab.projects 'Projects', projects_path %>
- # <% end %>
- # The HTML Result will be:
- #
-
- module ClassMethods
- def current_tab(name, options = {})
- before_filter(options) do |controller|
- controller.instance_variable_set('@current_tab', name)
- end
- end
- end
-
- module Helpers
- module ViewHelpers
- class Tab
-
- def initialize(context)
- @context = context
- end
-
- def current_tab
- @context.instance_variable_get('@current_tab')
- end
-
- def current_tab?(tab)
- current_tab.to_s == tab.to_s
- end
-
- def create_tab(tab, content)
- css_class = "class='current'" if tab.to_s == current_tab.to_s
- "#{content}".html_safe!
- end
-
- def method_missing(tab, *args, &block)
- if block_given?
- options = args.first || {}
- html_options = args.second || {}
- link_content = @context.capture(&block)
- link = @context.link_to (link_content, options, html_options)
-
- @context.concat create_tab(tab, link)
- else
- name = args.first
- options = args.second || {}
- html_options = args.third || {}
- link = @context.link_to (name, options, html_options)
-
- create_tab(tab, link)
- end
- end
-
- end
-
- def tabs(options={}, &block)
- raise ArgumentError, "Missing block" unless block_given?
- concat("".html_safe!)
- yield(Tab.new(self))
- concat('
'.html_safe!)
- end
-
- end
- end
-end
diff --git a/vendor/plugins/tabs_helper/test/tabs_helper_test.rb b/vendor/plugins/tabs_helper/test/tabs_helper_test.rb
deleted file mode 100755
index f849652..0000000
--- a/vendor/plugins/tabs_helper/test/tabs_helper_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'test/unit'
-
-class TabsHelperTest < Test::Unit::TestCase
- # Replace this with your real tests.
- def test_this_plugin
- flunk
- end
-end
diff --git a/vendor/plugins/tabs_helper/uninstall.rb b/vendor/plugins/tabs_helper/uninstall.rb
deleted file mode 100755
index 147579f..0000000
--- a/vendor/plugins/tabs_helper/uninstall.rb
+++ /dev/null
@@ -1 +0,0 @@
-# Uninstall hook code here
\ No newline at end of file