Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Sinatra extension to enable creating navigations with the simple-navigation gem. Also works for Padrino.

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 pkg
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 README.textile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 sinatra-simple-navigation.gemspec
README.textile

sinatra-simple-navigation

sinatra-simple-navigation is a sinatra extension enabling the use of the simple-navigation gem in your sinatra and padrino applications.

Installation

Either manually install the gem

gem install sinatra-simple-navigation

or preferably use bundler and add it to your Gemfile

gem 'sinatra-simple-navigation'

and run bundle install

Usage

Sinatra Applications

Classic Style

To use simple-navigation in your classic style sinatra application, just require ‘sinatra/simple-navigation’:

require 'rubygems'
require 'sinatra'
require 'sinatra/simple-navigation'

# Your app code goes here

Modular Style

If you’re developing a module style sinatra application (i.e. subclassing Sinatra::Base), you have to register Sinatra::SimpleNavigation:

require 'rubygems'
require 'sinatra/base'
require 'sinatra/simple-navigation'

class MyApp < Sinatra::Base
  register Sinatra::SimpleNavigation
  
  # Your app code goes here
end

Padrino Applications

Using simple-navigation in your padrino application is similar to the modular sinatra style. In your app/app.rb file:

require 'sinatra/simple-navigation'

class MyApp < Padrino::Application
  register Sinatra::SimpleNavigation
  
  # Your app code goes here
end

Instead of requiring sinatra/simple-navigation at the top of the file, you could add this to your Gemfile:

gem 'sinatra-simple-navigation', :require => 'sinatra/simple-navigation'

Resources

Legal

Copyright © 2010 Andi Schacke, released under the MIT license

Something went wrong with that request. Please try again.