Skip to content

Instantly share code, notes, and snippets.

@lfborjas
Created July 31, 2013 12:25
Show Gist options
  • Save lfborjas/6121551 to your computer and use it in GitHub Desktop.
Save lfborjas/6121551 to your computer and use it in GitHub Desktop.
inspect the rack env before it hits the rails app
#config/application.rb
config.middleware.use "Peekaboo"
#put this in lib/peekaboo.rb
class Peekaboo
def initialize(app)
@app = app
end
def call(env)
puts env.inspect
#here's where it hits the rails app, you could change anything in env before it
status, headers, response = @app.call(env)
[status, headers, response]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment