Skip to content

Instantly share code, notes, and snippets.

@agibralter
Created November 11, 2009 21:40
Show Gist options
  • Save agibralter/232337 to your computer and use it in GitHub Desktop.
Save agibralter/232337 to your computer and use it in GitHub Desktop.
class SomeMiddleware
def initialize(app, session_key)
@app = app
end
def call(env)
env['myapp.myvar'] = :something
@app.call(env)
end
end
class UsersController < ApplicationController
def show
if request.env['myapp.myvar'] == :something
# ...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment