# Simple Navigation for Bootstrap This gem adds a renderer for [Simple Navigation](http://github.com/andi/simple-navigation) to output markup compatible with [materialize](https://materializecss.com). ## Getting Started For Rails >= 3, simply add this gem to your `Gemfile`: ```ruby gem 'simple-navigation-materialize' ``` and run ``` bundle install ``` Follow the [configuration instructions](https://github.com/andi/simple-navigation/wiki/Configuration) on the Simple Navigation wiki for initial configuration. To use the Materialize renderer, specify it in your view: ```ruby render_navigation :renderer => :materialize ``` See below for a more complete example. ## Additional Functionality ### Icons In addition you may specify an `:icon` attribute on your navigation items, either as an array or string, containing materialize [icon names](https://materializecss.com/icons.html), to add an icon to the item. ### Dropdowns If you wish to use dropdowns in your navbar, don't forget to set `expand_all: true` on your `render_navigation`. ## Examples To create a navigation menu, you might do something like this: ```ruby SimpleNavigation::Configuration.run do |navigation| navigation.items do |primary| primary.item :music, 'Music', musics_path primary.item :dvds, 'Dvds', dvds_path, :split => true do |dvds| dvds.item :action, 'Action', dvds_action_path dvds.item :drama, 'Drama', dvds_drama_path end primary.item :books, 'Books', :icon => 'book' do |books| books.item :fiction, 'Fiction', books_fiction_path books.item :history, 'History', books_history_path end end end ``` ## Further Reading * [materialize Documentation](https://materializecss.com) * [Simple Navigation Wiki](https://github.com/andi/simple-navigation/wiki/) ## Contributions * [Simple Navigation for Bootstrap](https://github.com/pdf/simple-navigation-bootstrap) for the base of this code