-
-
Save lenary/174797 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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