Skip to content

Instantly share code, notes, and snippets.

@lenary
Forked from anonymous/gist:174777
Created August 25, 2009 16:40
Show Gist options
  • Select an option

  • Save lenary/174797 to your computer and use it in GitHub Desktop.

Select an option

Save lenary/174797 to your computer and use it in GitHub Desktop.
require 'sinatra'
module Sinatra
module Foo
module Helpers
def foo
@bar = 'Bye'
end
end
def self.registered(app)
app.helpers Helpers
app.set :foo, "bar"
app.get "/foo" do
erb :bar
end
end
end
register Foo
end
get '/hi' do
@bar = 'Hello'
foo
@bar
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment