Skip to content

Instantly share code, notes, and snippets.

@collinschaafsma
Created April 7, 2012 01:11
Show Gist options
  • Save collinschaafsma/2324360 to your computer and use it in GitHub Desktop.
Save collinschaafsma/2324360 to your computer and use it in GitHub Desktop.
Adding middleware with Railtie
module Foo
class Railtie < Rails::Railtie
initializer "foo.insert_middleware" do |app|
app.config.middleware.use "Foo::Middleware"
end
end
end
require "foo/railtie" if defined? Rails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment