SimpleMenu
A simple menu builder
Instalation
Add this line to your application's Gemfile:
gem 'very_simple_menu'
And then execute:
$ bundle
Run bundle install
Usage
Layout (or even view)
<%= simple_menu.add({
:products => ["Products", "/products"],
:services => ["Services", "/services"],
}) %>
View
# app/views/products/show.html.erb
<% simple_menu.active = :products %>
renders
<ul>
<li><a href="/products">Products</a></li>
<li><a href="/services">Services</a></li>
</ul>
Aditional Menus
<% simple_menu('sidebar').active = :all %>
<%= simple_menu('sidebar').add({
:all => ["All", "/products"],
:most_viewed => ["Most Viewed", "/products/most-viewed"],
}) %>
Author
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) Do not forget to write tests - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request