Many examples, such as these two:
How to use rack middleware with Rails3?
http://asciicasts.com/episodes/151-rack-middleware
define middleware in the class and then add
config.middleware.use "ClassNameHere"
to config/application.rb , but I can't figure out where to add this in application.rb. I put it inside the class Application < Rails::Application . I'm also not sure if there is a specific place where I put my middleware class. I have my / lib.
Say my middleware class is called ResponseTimer, I get the following error when starting rake middleware : uninitialized constant ResponseTimer
Note that I'm in Rails 3.1, not 2.x, so I don't put config.middleware.use in environment.rb
snowleopard Jul 13 2018-12-12T00: 00Z
source share