This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Daniel Haran (author)
Wed Sep 16 13:50:55 -0700 2009
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Sat Oct 25 14:58:48 -0700 2008 | |
| |
README | Wed May 20 12:45:02 -0700 2009 | |
| |
Rakefile | Thu Oct 23 20:34:25 -0700 2008 | |
| |
TODO | Mon Oct 27 11:02:08 -0700 2008 | |
| |
init.rb | Thu Oct 23 20:34:25 -0700 2008 | |
| |
install.rb | Thu Oct 23 20:34:25 -0700 2008 | |
| |
lib/ | Wed Sep 16 13:50:55 -0700 2009 | |
| |
public/ | Fri May 22 07:24:11 -0700 2009 | |
| |
tasks/ | Thu Oct 23 20:34:25 -0700 2008 | |
| |
test/ | Wed Sep 16 13:50:55 -0700 2009 | |
| |
uninstall.rb | Thu Oct 23 20:34:25 -0700 2008 |
README
= SemanticMenu
A plugin to make large menus easier to write.
Supports arbitrarily deep nesting; parents will be marked as 'active' if any of its children are active.
== Example
<%= semantic_menu do |root|
root.add "overview", root_path
root.add "comments", comments_path
end %>
Assuming you are on /comments, the output would be:
<ul class="menu">
<li>
<a href="/">overview</a>
</li>
<li class="active">
<a href="/comments">comments</a>
</li>
</ul>
add and semantic_menu both take an optional parameter hash, and you can nest the menu as deeply as you want:
<%= semantic_menu :class => 'top_level_nav' do |root|
root.add "overview", "root_path"
root.add "comments", "comments_path", :class => 'button' do |comments|
comments.add "My Comments", "my_comments_path"
comments.add "Recent", "recent_comments_path"
end
end %>
This would look like this:
<ul class="top_level_nav">
<li>
<a href="root_path">overview</a>
</li>
<li class="active">
<a href="comments_path" class="button">comments</a>
<ul class="menu_level_1">
<li class="active">
<a href="my_comments_path">My Comments</a>
</li>
<li>
<a href="recent_comments_path">Recent</a>
</li>
</ul>
</li>
</ul>
Copyright (c) 2008 Daniel Haran, released under the MIT license







