Displaying 1 result from an estimated 1 matches for "custom_middlewar".
Did you mean:
custom_middleware
2013 May 13
0
Middleware example from Railscast #151 doesn't work as expected. Need help.
...s follows:
## in \lib\response_timer.rb
## this is the class of my custom middleware:
class ResponseTimer
def initialize(app)
@app = app
end
def call(env)
[200, {"Content-Type" => "text/html"}, "Hello, World!"]
end
end
## in \config\initializers\custom_middleware.rb
## this is an initializer file that I created. It''s goal is to add my
## middleware "ResponseTimer" to the middleware stack:
module Demo
class Application < Rails::Application
config.after_initialize do
Rails.application.config.middleware.insert_after(ActionDi...